我正在尝试在 Eclipse 上运行一个 Selenium 脚本,它为我提供了选项列表。
我收到以下错误:
线程“主”org.apache.bcel.verifier.exc.AssertionViolatedException 中的异常:发现:内部错误:糟糕!退出!!在 org.apache.bcel.verifier.exc.AssertionViolatedException.main(AssertionViolatedException.java:102) 拾取 JAVA_TOOL_OPTIONS: -agentlib:jvmhook 拾取 _JAVA_OPTIONS: -Xrunjvmhook -Xbootclasspath/a:C:\PROGRA~1\HP\QUICKT ~1\bin\JAVA_S~1\classes;C:\PROGRA~1\HP\QUICKT~1\bin\JAVA_S~1\classes\jasmine.jar
无法理解为什么它jasmine.jar
从 QTP 文件夹中挑选。
我的班级文件:
package seleniumsample;
import org.openqa.selenium.*;
import org.openqa.selenium.firefox.FirefoxDriver;
import com.google.common.base.Strings;
public class Sample {
public static void main(Strings[] args) {
String baseUrl=" http://www.demo.guru99.com/V4";
String username="mngr55483";
String password="sUqEzed";
WebDriver driver= new FirefoxDriver();
driver.get(baseUrl);
WebElement userElement=driver.findElement(By.name("uid"));
System.out.println("userelement found");
userElement.sendKeys(username);
WebElement pwdElement= driver.findElement(By.name("password"));
System.out.println("pwdelement found");
pwdElement.sendKeys(password);
WebElement loginElement= driver.findElement(By.name("btnLogin"));
System.out.println("loginelement found");
loginElement.click();
driver.close();
}
}