Quantcast
Channel: Active questions tagged selenium - Stack Overflow
Viewing all articles
Browse latest Browse all 97762

Control findable using selenium/javascript not findable in cucumber/selenium/javascript

$
0
0

I use Cucumber/selenium/JavaScript to log into my application page. This works with no problem. After I log in, however, the system won't wait for the control to be visible and reports that it can't find it.

If I do the same exercise using only JavaScript and selenium, the control is visible after 4 seconds (I use "'''driver.sleep(4000)'''" and selenium finds it without problem.

I'm fairly new to Cucumber. How do I dynamically detect control existence without failing?

The attached code sample is what's failing in Cucumber but succeeding in selenium after a 4 second wait.

When('I click Login', async function () {
    loginButton = await driver.findElement(By.xpath(".//* [@id='loginButton']"));
loginButton.click();

});

I expected an asynchronous function with a 9 second timeout defined in world.js (this.setDefaultTimeout(90 * 1000);) to wait for controls to appear.

This straightforward assumption fails. What am I missing or doing wrong?


Viewing all articles
Browse latest Browse all 97762

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>