如果我调试相同的代码,那么它可以正常工作,但是当运行此代码时,鼠标操作不起作用。代码如下 -
public static void main(String[] args) {
FirefoxDriver driver = new FirefoxDriver();
driver.get("url");
driver.findElementByXPath("xpath").click();
driver.findElementByXPath("xpath").sendKeys("gg");
driver.findElementByXPath("xpath").click();
boolean saleIdVisible =driver.findElementByXPath("path").isEnabled();
if(saleIdVisible==true){
Actions mouseaction=new Actions(driver);
WebElement payment_lk1 = driver.findElement(By.xpath("path"));
mouseaction.moveToElement(payment_lk1).build().perform();
mouseaction.click(payment_lk1).build().perform();
System.out.println("order id is not found ");
}else{
System.out.println("order id is found ");
}
driver.findElementByXPath("path").click();
driver.findElementByXPath("path").click();
driver.findElementByXPath("path").clear();
driver.findElementByXPath("path").sendKeys("95032");
driver.findElementByXPath("path").click();
}