Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- screenRecorder = new ScreenRecorder(gconfig,
- new Format(MediaTypeKey, MediaType.FILE, MimeTypeKey,
- MIME_AVI),
- new Format(MediaTypeKey, MediaType.VIDEO, EncodingKey,
- ENCODING_AVI_TECHSMITH_SCREEN_CAPTURE,
- CompressorNameKey, ENCODING_AVI_TECHSMITH_SCREEN_CAPTURE,
- DepthKey, (int)24, FrameRateKey, Rational.valueOf(15),
- QualityKey, 1.0f,
- KeyFrameIntervalKey, (int) (15 * 60)),
- new Format(MediaTypeKey, MediaType.VIDEO,
- EncodingKey,"black",
- FrameRateKey, Rational.valueOf(30)), null);
- WebDriver d = new FirefoxDriver();
- // Start Capturing the Video
- // screenRecorder.start();
- // Puts an Implicit wait, Will wait for 10 seconds before throwing exception
- d.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
- // Launch website
- d.navigate().to("http://cinebels.dnmdigital.com/");
- d.findElement(By.xpath(".//*[@id='ban-nav']/li[2]/a")).click();
- // Mousehover Actions
- Actions action = new Actions(d);
- WebElement hover0 = d.findElement(By.xpath("//*[@id='head-nav']/li[1]/a"));
- WebElement hover = d.findElement(By.xpath("//*[@id='head-nav']/li[1]/div/div/div[1]/h5"));
- action.moveToElement(hover0).moveToElement(hover);
- action.moveToElement(d.findElement(By.xpath("//*[@id='head-nav']/li[1]/div/div/div[1]/ul/li[1]/a")))
- .click().build().perform();
- //Home Automation page
- d.findElement(By.xpath("//*[@id='head-nav']/li[3]/a")).click();
- //Av Equipment
- d.findElement(By.xpath("//*[@id='soln']/div/div/div[1]/a/div[2]/img")).click();
- //Brands
- Actions action1 = new Actions(d);
- WebElement hoverb = d.findElement(By.xpath("//*[@id='head-nav']/li[4]/a"));
- WebElement hoverb1 = d.findElement(By.xpath("//*[@id='head-nav']/li[4]/div/div/div[1]/div[2]/div[1]/ul/li/a/img"));
- action1.moveToElement(hoverb).moveToElement(hoverb1);
- action1.moveToElement(d.findElement(By.xpath("//*[@id='head-nav']/li[4]/div/div/div[1]/div[2]/div[1]/ul/li/a/img")))
- .click().build().perform();
- //for (int i = 1; i<=links.size(); i=i+1) {
- // System.out.println("Name of Link# " + i + links.get(i).getText());
- //}
- File screenshot = ((TakesScreenshot)d).getScreenshotAs(OutputType.FILE);
- FileUtils.copyFile(screenshot, new File("D:\screenshots\screenshots1.jpg"));
- // Close the Browser.
- // d.close();
- // Stop the ScreenRecorder
- // screenRecorder.stop();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement