Wait for time to execute new action [Selenium] [C #]

1

I'm starting with test automation with Selenium WebDriver in the C # language . I have a question, I have to make the test wait for the page load to perform a new action. How do I do that? I think the easiest is to do it for time. Can someone help me?

    
asked by anonymous 03.12.2015 / 18:13

1 answer

1

There are 4 ways to wait.

Implicitly, it applies to all elements of the page.

driver.manage().timeouts().implicitlyWait(ALGUM_NUMERO, TimeUnit.SECONDS);

Explicitly applied to a particular element.

WebDriverWait.until(CONDICAO_QUE_BATE_COM_O_ELEMENTO);

And for more specific cases.

WebDriverWait espera = new WebDriverWait(driver, 40);
WebElement element = espera.until(ExpectedConditions.elementToBeClickable(By.id("algumid")));

Using thread.

Thread.sleep(NUMBER_OF_MILLIS);

@fonte

    
03.12.2015 / 18:20