首页 \ 问答 \ 如何从黄瓜/ aruba捕获shell脚本程序输出?(How to capture shell script program output from cucumber/aruba?)

如何从黄瓜/ aruba捕获shell脚本程序输出?(How to capture shell script program output from cucumber/aruba?)

我想从黄瓜功能文件中捕获我正在运行的输出。

我创建了一个shell脚本程序并将其放在/ usr / local / bin /中,因此可以从系统中的任何位置访问它。

abc_qa.sh -

arg=$1
if [[ $arg = 1 ]]
then
    echo $(date)
fi

黄瓜项目结构 -

阿鲁巴 -

├──功能

│├──支持

││└──env.rb

│└──use_aruba_cucumber.feature

├──Gemfile

Gemfile -

source 'https://rubygems.org'
gem 'aruba', '~> 0.14.2'

env.rb -

require 'aruba/cucumber'

use_aruba_cucumber.feature -

Feature: Cucumber
 Scenario: First Run
    When I run `bash abc_qa.sh 1`

我想在黄瓜本身捕获这个abc_qa.sh程序输出,并通过使用任何类型的简单测试来比较这个日期是对还是错,并将此测试作为通过。


I want to capture output which I'm running from the cucumber feature file.

I created one shell script program and placed it in /usr/local/bin/ so it can be accessible from anywhere in system.

abc_qa.sh -

arg=$1
if [[ $arg = 1 ]]
then
    echo $(date)
fi

project structure of cucumber -

aruba -

.

├── features

│ ├── support

│ │ └── env.rb

│ └── use_aruba_cucumber.feature

├── Gemfile

Gemfile -

source 'https://rubygems.org'
gem 'aruba', '~> 0.14.2'

env.rb -

require 'aruba/cucumber'

use_aruba_cucumber.feature -

Feature: Cucumber
 Scenario: First Run
    When I run `bash abc_qa.sh 1`

I want to capture this abc_qa.sh program output in the cucumber itself and compare this date is right or wrong by using any kind of simple test and make this test as a pass.


原文:https://stackoverflow.com/questions/40436944
更新时间:2023-04-30 12:04

最满意答案

不幸的是,你不能用Selenium IDE做到这一点。 IDE并不是设计用来做这样的事情,因为Selenium Rc允许你做IDE可以做的事情以及更多,因为你使用你喜欢的语言与代理说话,然后使用该语言的能力写入的东西磁盘。

IDE旨在帮助您使用记录功能获取测试用例的框架,然后进行调整,重播以查看其工作情况,然后导出为您喜欢的语言


Unfortunately you can not do this with Selenium IDE. The IDE has not been designed to do things like this since there is Selenium Rc that allows you to do what the IDE can do and more since you use your favourite language to speak to a proxy and then use that language's ability to write things to the disk.

The IDE is designed to help you get the skeleton of a test case with the record function, you then tweak it, replay to see it works and then export to your favourite language

相关问答

更多