Sunday, 14 May 2017

Firefox doesn't wait for a page load Webdriverio

I am trying to run my test using Selenium and just encountered the problem. I have my test written for the Chrome browser. Now I have been trying to run the same tests in the Firefox browser, but they failed.

I've started to investigate the problem and found out that Firefox doesn't wait until page is fully loaded. Chrome works perfectly.

I am running Selenium in docker containers.

Here is my script

storeSearch(info) {
        let that = this;
        return new Promise(function (resolve, reject) {
            browserClient.init()
                .url("http://somewhere.com")
                .selectByVisibleText("#store","Tech")
                // Redirect to a new page
                .setValue("input[name='search']", info.searchCriteria)
                .selectByValue(".featured", 'MacBook')
                .click("button[name='info']")
                .element('.popup')
                .then(function (element) {
                    if (element.state === 'success') {

                    }
                });
        });
    }

It doesn't try even to select a store type from the select .selectByVisibleText("#store","Tech") and just throws an exception.

"An element could not be located on the page using the given search parameters (\"input[name='search']\").",

I have tried to add timeouts but it doesn't work as well and gives me an error.

  browserClient.init()
                    .url("http://somewhere.com")
                    .timeouts('pageLoad', 100000)
                    .selectByVisibleText("#store","Tech")

The following error is thrown.

"Unknown wait type: pageLoad\nBuild info: version: '3.4.0', revision: 'unknown', time: 'unknown'\nSystem info: host: 'ef7581676ebb', ip: '172.17.0.3', os.name: 'Linux', os.arch: 'amd64', os.version: '4.9.27-moby', java.version: '1.8.0_121'\nDriver info: driver.version: unknown

I have been trying to solve this problem for two days, but no luck so far.

Could someone help, maybe you have some ideas what can cause the problem ?

Thanks.



via bxfvgekd

No comments:

Post a Comment