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

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

فهرست وبلاگ