Explore Courses Blog Tutorials Interview Questions
0 votes
1 view
in Selenium by (7k points)
edited by

I am trying to play the video by using JUnit.  After playing the video I need to take a screen shot. I am able to close this video window but not able to play/pause this video.

To close the video I have used code

 WebDriverWait wait = new WebDriverWait(driver, 20); wait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath(xPath))).click(); 

Please help me.

1 Answer

0 votes
by (31.9k points)

You can use the following code:

WebDriver driver=new FirefoxDriver();


WebElement element=driver.findElement(By.xpath("//a[contains(text(),'Open a Div in Lightbox')]"));;

WebElement frameElement=driver.findElement(By.xpath("//iframe[@src='']"));



Want to learn Selenium, checkout our Selenium training. 

Browse Categories