Monday 23 May 2022

Implicit Wait in Selenium Webdriver | Selenium Implicit Wait Java Example | implicitlywait Selenium

                  In this post, we will see Implicit Wait in Selenium Webdriver | Selenium Implicit Wait Java Example | implicitlywait Selenium  


Program Code:

import java.util.concurrent.TimeUnit;


import org.openqa.selenium.By;

import org.openqa.selenium.WebDriver;

import org.openqa.selenium.chrome.ChromeDriver;

import java.time.Duration;


public class ImplicitWait {


@SuppressWarnings("deprecation")

public static void main(String[] args) throws InterruptedException 

{

System.setProperty("webdriver.chrome.driver", "C:\\selenium\\chromedriver_win32\\chromedriver.exe");

WebDriver driver=new ChromeDriver();

driver.get("https://in.bookmyshow.com/explore/movies-pune");

driver.manage().window().maximize();

driver.manage().timeouts().implicitlyWait(Duration.ofSeconds(5));

driver.findElement(By.xpath("(//div[text()='Marathi'])[3]")).click();

driver.findElement(By.xpath("//img[@alt='Chandramukhi (Marathi)']")).click();

driver.navigate().back();

driver.findElement(By.xpath("(//div[text()='English'])[3]")).click();

driver.findElement(By.xpath("//img[@alt='Top Gun: Maverick']")).click();

}


}  


Watch following video:


Watch on YouTube: https://www.youtube.com/watch?v=YBcFp_HnNdI&list=PLhbrpS8rYbc0vBS6Z8SC7OR-zknTBiBHW&index=16

No comments:

Post a Comment