简体   繁体   English

从Linux中的终端启动Selenium WebDriver测试

[英]Launch selenium webdriver test from terminal in linux

I wrote a simple regression test for a website with a little GUI to launch the test. 我为一个带有少许GUI的网站编写了一个简单的回归测试,以启动该测试。 Works fine in eclipse but for some reason it will stall after pressing the launch button on the GUI when I try to run it from the terminal. 在eclipse中可以正常工作,但是由于某些原因,当我尝试从终端运行它时,在按下GUI上的启动按钮后,它将停止。 The web driver will launch firefox but the page stays blank when its supposed to go to the URL of the site I'm testing. Web驱动程序将启动firefox,但当页面转到我要测试的网站的URL时,页面将保持空白。 I believe this has to do with error in configuring the classpath, I have the following in a shell script 我相信这与配置类路径中的错误有关,我在shell脚本中有以下内容

javac -classpath ":ojdbc6.jar:selenium-server-2.33.0.jar:selenium-server-standalone-2.33.0.jar" Test.java
java -classpath ":ojdbc6.jar:selenium-server-2.33.0.jar:selenium-server-standalone-2.33.0.jar" Test

Why does it stall and how to fix it? 为什么会停顿以及如何解决?

I use the Junit ant task to run my tests. 我使用Junit ant任务运行测试。 It will run my tests and print a nice looking html report at the other end for clear results. 它将运行我的测试,并在另一端打印漂亮的html报告以获得清晰的结果。

Use Ant or Maven build tool with Junit or TestNG framework as both framework has capability of running test from terminal and generating nice html formated report. 将Ant或Maven构建工具与Junit或TestNG框架一起使用,因为这两个框架都具有从终端运行测试并生成漂亮的html格式的报告的功能。 Here is a sample project with ant build script you can get from my github account. 这是一个带有ant build脚本的示例项目,您可以从我的github帐户获得。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM