Friday, 28 April 2017

Click buttons on page until all will be removed

My scenario: On page I have multiple buttons. After button is clicked, page is reloaded without clicked button.

I have problem with implementation of proper solution. Currently I have something like that:

    let selector = 'selector for All button on page';
    let buttons = browser.$$(selector);

    for(int i = 0; i< buttons.length; i++){
    let button = browser.$(selector);
    button.moveToObject();
    button.waitForVisible();
    button.click();
    browser.waitToVisible(elementAfterPageRefresh);
    }

Problem occurs after first iteration. Sometimes works only moving to button, sometimes script not even finds second button :/

What is proper way to solve my problem with webdriverio?



via netmajor

No comments:

Post a Comment