Selenium: Looping concept, how to implement loop in selenium script?

Описание к видео Selenium: Looping concept, how to implement loop in selenium script?

In this video we will see how to apply loops in order to maintain the code quality. When same action is expected to perform again and again instead of writing same code multiple times better to use loop.

I hope you like this video. For any questions, suggestions or appreciation please contact us at: https://programmerworld.co/contact/ or email at: [email protected]

Details also available in below:
https://programmerworld.co/selenium/s...


Code:

driver.get("web page url");

driver.findElement(By.xpath("//div[@data-testid=\"home-page-travellers\"]")).click();

for(int i=1;i LESS_THAN 6;i++)
{
driver.findElement(By.xpath("//div[@data-testid=\"Adult-testID-plus-one-cta\"]")).click();
}

Комментарии

Информация по комментариям в разработке