初始化引导层java.lang.module.FindException时出错:无法为C:\users\admin\eclipse-workspace\testing\lib\selenium-server-standalone.jar派生模块描述符
Caused by: java.lang.module.InvalidModuleDescriptorException: Provider class org.eclipse.jetty.http.Http1FieldPreEncoder not in module
package Testing;
import com.thoughtworks.selenium.DefaultSelenium;
import com.thoughtworks.selenium.Selenium;
public class Testing {
public static void main(String[] args) throws InterruptedException
{
Selenium selenium= new DefaultSelenium("localhost",4444,"firefox","http://www.calculator.net");
selenium.start();
selenium.open("/");
selenium.windowMaximize();
selenium.click("xpath=.//*[@id=''hl3']/li[3]/a");
Thread.sleep(4000);
selenium.focus("id=cpar1");
selenium.type("css=input[id=\"cpar1\"]", "10");
selenium.focus("id=cpar2");
selenium.type("css=input[id=\"cpar2\"]", "50");
(selenium).click("xpath=.//*[@id='content']/table[1]/tbody/tr[2]/td/input[2]");
// verify if the result is 5
Thread.sleep(4000);
String result = selenium.getText("xpath=.//*[@id='content']/p[2]/font/b");
//String result = selenium.getValue("xpath=.//*[@id='cpar3']");
System.out.println("Result:"+result);
if (result.equals("5")/*== "5"*/){
System.out.println("Pass");
}
else{
System.out.println("Fail");
}
}
}
>
一旦您实现了选项1,去掉那些thread.sleep()(因为它是某种形式的性能反模式),改用显式Wait,查看如何使用Selenium使用AJAX技术测试web应用程序以获得全面的解释和代码示例。
最好使用像Apache Maven这样的依赖关系管理解决方案,它将自动检测并下载项目的可传递依赖关系。相关的pom.xml文件如下所示:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.example</groupId>
<artifactId>selenium</artifactId>
<version>1.0-SNAPSHOT</version>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>8</source>
<target>8</target>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>3.141.59</version>
</dependency>
</dependencies>
</project>
启动层java.lang.module.FindException初始化时出错:无法为C:\users\admin\eclipse-workspace\testing\lib\selenium-server-standalone.jar派生模块描述符
我正在尝试使用以下命令单独使用硒启动chrome 但是,当我触发我的网页驱动测试铬时,它会暂时打开铬,它崩溃并出现以下错误 { " trace id ":" faca 75 a3 db 657 eed 4b 96 bdac 93977746 "," eventTime": 1637343152240678600," eventName": "exception "," attributes ":{
我得到错误,当我试图运行TestNG项目与Java11通过Eclipse 启动层java初始化期间出错。lang.module。FindException:无法派生C:\Users\ShefaliBajaj\Downloads\eclipse-java-2018-12-R-win32-x86\U 64\eclipse\plugins\org的模块描述符。testng_6.14.3。r2018022
问题内容: 我正在尝试导入WebDriver和ChromeDriver,尝试了所有的尝试,但没有运气 摆脱错误 问题答案: 硒罐必须添加到项目中以标识接口和类 硒下载链接:http : //www.seleniumhq.org/download/
错误[org.jboss.as.controller.management-Operation](ServerService线程池--31)JBAS014613:Operation(“add”)失败-地址:([(“subsystem”=>“Datasources”),(“jdbc-driver”=>“PostgresJdbcDriver”)])-失败描述:“JBAS010441:无法加载驱动程序[