如何从命令行启动Selenium IDE,并加载特定测试用例? [英] How do I launch the Selenium IDE from the command line with a specific test case loaded?

查看:1200
本文介绍了如何从命令行启动Selenium IDE,并加载特定测试用例?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Windows上,我想启动Firefox和Selenium IDE,并加载指定的测试用例并准备播放。



我有

 >C:\Program Files(x86)\Mozilla Firefox\firefox.exe -chromechrome:// selenium-ide / content

启动Firefox和IDE,我不太了解Selenium IDE或Chrome得到任何进一步。我会期望像:

 >C:\Program Files(x86)\Mozilla Firefox\firefox .exe-chromechrome:// selenium-ide / content?test = foo.html



作为背景,我从一个Swing应用程序生成测试用例模板,并希望只是平移它们到Firefox中,通过单击按钮进行修改和执行。如果有一个比Runtime.getRuntime.exec(theAbove)更容易的方法,那么我大笑。

解决方案

更接近。 Selenium有一个内置页面,可以从名为 TestRunner.html 的测试套件自动加载和执行测试。您可以按照以下方式调用它

  c:\Program Files\Mozilla Firefox\firefox.exe-chromechrome ://selenium-ide/content/selenium-core/TestRunner.html?baseUrl = http:// [BASEURL]& test = file:/// [TESTSUITE-PATH]& auto = false

这将firefox firefox与测试套件在指定的路径加载和等待执行一个单一的测试



在创建了几个硒测试之后,按



保存测试用例testcase1.html和testcase2.html在一个文件夹说c:\tests。



将testsuite作为testsuite.html保存在同一个文件夹中现在你可以使用以下命令行启动
这些测试套件。

  c:\Program Files\Mozilla Firefox \firefox.exe-chromechrome://selenium-ide/content/selenium-core/TestRunner.html?baseUrl = http:// localhost& test = file:/// c:\tests\testsuite .html& auto = false



你应该在Firefox中加载测试,准备执行。 / p>

如果您更改上述网址以将auto参数设置为true,那么它将在启动后运行测试。

 & auto = true 



已将 baseurl 参数更改为区分大小写的表单: baseUrl



更新到 TestRunner.html 的路径:
chrome://selenium-ide/content/selenium-core/TestRunner.html


I'm on Windows, and I want to launch Firefox and the Selenium IDE with a specified test case loaded and ready to play back.

I've got as far as:

>"C:\Program Files (x86)\Mozilla Firefox\firefox.exe" -chrome "chrome://selenium-ide/content"

which launches Firefox and the IDE, but I don't know enough about the Selenium IDE or Chrome to get any further. I'd expect something like:

>"C:\Program Files (x86)\Mozilla Firefox\firefox.exe" -chrome "chrome://selenium-ide/content?test=foo.html"

to be supported, but I can't find the right incantation.

As background, I'm generating test case templates from a Swing application and want to just punt them into Firefox for modification and execution with a single button-press. If there's an easier way to do that than Runtime.getRuntime.exec(theAbove) then I'm all ears.

解决方案

You are closer. Selenium has a built in page to auto load and execute tests from an test-suite called TestRunner.html. you can invoke it like follows

c:\Program Files\Mozilla Firefox\firefox.exe" -chrome "chrome://selenium-ide/content/selenium-core/TestRunner.html?baseUrl=http://[BASEURL]&test=file:///[TESTSUITE-PATH]&auto=false"

This will fireup firefox with all tests from the test-suite at the specified path loaded up and waiting to execute in a single button press.

For example

after creating a couple of selenium tests, save the testcases as testcase1.html and testcase2.html in a folder say c:\tests.

Save the testsuite as testsuite.html in the same folder. Now you can launch these suite of tests with the below command line.

c:\Program Files\Mozilla Firefox\firefox.exe" -chrome "chrome://selenium-ide/content/selenium-core/TestRunner.html?baseUrl=http://localhost&test=file:///c:\tests\testsuite.html&auto=false"

You should have the tests loaded up in firefox ready to execute.

if you change the above url to have auto parameter to true, then it will run the tests as well after launch.

&auto=true

EDIT :

Updated baseurl argument to proper case sensitive form: baseUrl

Updated path to TestRunner.html to: chrome://selenium-ide/content/selenium-core/TestRunner.html

这篇关于如何从命令行启动Selenium IDE,并加载特定测试用例?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆