ide循环执行用例 selenium,如何从命令行启动Selenium IDE,并加载特定测试用例?

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

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值