Note that there are some explanatory texts on larger screens.

plurals
  1. POhow i can take a screenshot of a flash video while its playing using selenium webdriver?
    primarykey
    data
    text
    <p>To automate the testing of videos, we decided to capture the screenshots of the video while its playing and compare those screenshots in order to ensure the video getting played. But when i am trying to capture the screenshots of the video player while video is getting played, only the black screen is getting displayed.</p> <p>We are using selenium web-driver and JAVA for developing the automation scripts. Is there any other way that we can ensure the videos are getting played or not. Is there any flash support needed for taking screenshots of a flash video getting played?</p> <p>Please help us with this. Is the method we following the correct one for video testing?</p> <p>Please find my below selenium web-driver code</p> <h2>CODE</h2> <pre><code>import java.io.File; import java.io.IOException; import org.apache.commons.io.FileUtils; import org.openqa.selenium.By; import org.openqa.selenium.OutputType; import org.openqa.selenium.TakesScreenshot; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebDriverException; import org.openqa.selenium.WebElement; import org.openqa.selenium.firefox.FirefoxDriver; public class Screenshot { public static void main(String[] args) throws InterruptedException, IOException { FirefoxDriver driver = new FirefoxDriver(); driver.manage().window().maximize(); FlashObjectWebDriver flashapp=null; flashapp = new FlashObjectWebDriver(driver,"PlayerPlatformAPI"); driver.get("Flash media player URL"); Thread.sleep(1000L); WebElement streamurl = driver.findElement(By.name("Stream URL")); streamurl.clear(); streamurl.sendKeys("video link"); WebElement tune=driver.findElement(By.xpath("//div[@id='outer']//input[@type='button']")); tune.click(); Thread.sleep(1000L); driver.findElement(By.id("PlayerPlatformAPI")); screen.seekTo(50); flashapp.callFlashObject("SeekTo","50"); int i; for(i=0;i&lt;4;i++) { File scrFile = ((TakesScreenshot)driver).getScreenshotAs(OutputType.FILE); // Now you can do whatever you need to do with it, for example copy somewhere File file1 = new File("c:\\tmp\\"+i+"_scrnshot.jpeg"); FileUtils.copyFile(scrFile,file1); Thread.sleep(10000); } driver.close(); } } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload