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

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

    خبرنامه

    عضویت

    نام کاربري :
    رمز عبور :