我正在使用Selenium WebDriver,Eclipse,TestNG和Surefire插件.我无法从pom.xml运行testng.xml文件.当我使用mvn test运行pom.xml时,它直接运行src/test/java中的文件.
我的pom.xml代码是
<groupId>angel</groupId>
<artifactId>Angel</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>
<name>Angel</name>
<url>http://maven.apache.org</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> </properties>
<dependencies>
<!-- Java API to access the Client Driver Protocols -->
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>2.21.0</version>
</dependency>
<!-- JExcel API is a java library which provides the ability to read, write, and modify Microsoft Excel spreadsheets.-->
<dependency>
<groupId>net.sourceforge.jexcelapi</groupId>
<artifactId>jxl</artifactId>
<version>2.6.10</version>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.14</version>
</dependency>
<!-- Java API for manipulate the Microsoft Excel Sheets. -->
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-contrib</artifactId>
<version>3.5-beta5</version>
</dependency>
<!-- Java Mail …Run Code Online (Sandbox Code Playgroud) 只是想知道在运行selenium场景时我们是否可以做类似下面的事情,这需要用户的互动才能继续.喜欢等他上传一些图片..
直到这一步,selenium弹出一个对话框说:请完成一些事情,然后单击确定按钮继续.
当用户在网页上完成操作时,单击"确定",然后场景的事务正在向前移动.否则,停止该步骤.
对于第一颗子弹,我在想下面的命令:
命令:
waitForConfirmation
Run Code Online (Sandbox Code Playgroud)
目标:
javascript{confirm("Please upload the images, then click OK to continue")}
Run Code Online (Sandbox Code Playgroud)
提前致谢!
如何使用selenium IDE检查是否隐藏了HTML元素(display:none :)?
在我的情况下,html是一个按钮,如果元素被隐藏,我希望selenium告诉我.
如果我使用verifyElementPresent,selenium会找到该元素,尽管它是隐藏的.
谢谢!