Webdriver trying to click on button but receiving 'server did not provide a static trace'?

ساخت وبلاگ

Vote count: 0

Webdriver trying to click on button but receiving 'server did not provide a static trace'?

The button which im trying to click:

I have created the following method listed below, for example 96 builds would pass but then i would get 4 which would fail due to the indicated exception:

public void clickOnBuyNowButton() throws InterruptedException { WebElement buyNowButton = driver.findElement(By.xpath("(//input[@value='Buy Now' and @value='Buy Now'])[2]")); boolean clicked = false; int attempts = 0; while (!clicked && attempts < 5000) { try { Thread.sleep(2000); this.wait.until(ExpectedConditions.elementToBeClickable(buyNowButton)).isEnabled(); actionMoveAndClick(buyNowButton); clicked = true; } catch (Exception e) { System.out.println("Unable click on 'BuyNow' button | clickOnBuyNowButton()"); Assert.fail("Method failed: waitAndClickElement"); } attempts++; }
}

Thanks for your help

asked 1 min ago

back soft...
ما را در سایت back soft دنبال می کنید

برچسب : نویسنده : استخدام کار backsoft بازدید : 331 تاريخ : چهارشنبه 27 ارديبهشت 1396 ساعت: 16:06