我想从命令行运行 Selenium 测试用例文件 [英] I want to run Selenium test case file from command line

查看:32
本文介绍了我想从命令行运行 Selenium 测试用例文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

然后我用 Firefox 扩展Selenium IDE"保存了一个测试用例.

I made then saved a test case with the Firefox extension "Selenium IDE".

现在我想使用命令行来运行这个导出的 html 文件.

Now I want to use command line to run this exported html file.

我试着按照这个how-do-i-launch-the-selenium-ide-from-the-command-line-with-a-specific-test-case 但它不起作用.

I try to follow this how-do-i-launch-the-selenium-ide-from-the-command-line-with-a-specific-test-case but it doesn't work.

请帮帮我.

推荐答案

您将需要 Selenium RC,您可以从:
http://seleniumhq.org/download/

和 Java 1.5 或更高版本(在此处下载 Java)

You will need the Selenium RC which you can get from:
http://seleniumhq.org/download/

And Java 1.5 or higher (Download Java here)

1) 安装 Java
2) 解压 Selenium RC.
3) 打开一个 cmd.exe 窗口并进入包含 Selenium Server 的目录 (selenium-remote-control-1.0.1\selenium-server-1.0.1)
4) 运行以下命令:

1) Install Java
2) Unpack Selenium RC.
3) Open a cmd.exe window and go to the directory containing the Selenium Server (selenium-remote-control-1.0.1\selenium-server-1.0.1)
4) Run the command below:

java -jar selenium-server.jar -htmlSuite "*firefox" "http://10.8.100.106" "C:\mytestsuite\mytestsuite.html" "C:\mytestsuite\results.html"

这应该会在 Firefox 中运行您的测试套件并将结果写入 html 文件.显然,您需要将 "http://10.8.100.106" 参数更改为您自己的服务器(这可能只是 localhost/127.0.0.1)

This should run your test suite in Firefox and write the results to the html file. Obviously you will need to change the "http://10.8.100.106" argument to your own server (this might just be localhost / 127.0.0.1)

这篇关于我想从命令行运行 Selenium 测试用例文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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