Z
Z
Zhenya Starikov2021-10-14 07:10:38
Codeception
Zhenya Starikov, 2021-10-14 07:10:38

How to wait for a link to be followed after a click() without an explicit wait()?

Hello. I'm using codeception for acceptance tests and would like to know how to wait for the page to load after following a link with click() without using an explicit wait() with a number of seconds. In webdriver options I have set smartWait.
see() waits for the text, the button, but what about the title? seeInTitle() does not wait for the page to load after a redirect and immediately throws an error (compares the old title). I would like something like wait.untill(seeInTitle()), but I could not find anything like it.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Maxim Fedorov, 2021-10-14
@Maksclub

Have you seen that it doesn't work with all locators?

It is important to understand that SmartWait works only with a specific locators:
#locator - CSS ID locator, works
//locator - general XPath locator, works
['css' => 'button''] - strict locator, works

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question