Advertisement
Guest User

Untitled

a guest
Dec 6th, 2016
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.32 KB | None | 0 0
  1. screenRecorder = new ScreenRecorder(gconfig,
  2. new Format(MediaTypeKey, MediaType.FILE, MimeTypeKey,
  3. MIME_AVI),
  4. new Format(MediaTypeKey, MediaType.VIDEO, EncodingKey,
  5. ENCODING_AVI_TECHSMITH_SCREEN_CAPTURE,
  6. CompressorNameKey, ENCODING_AVI_TECHSMITH_SCREEN_CAPTURE,
  7. DepthKey, (int)24, FrameRateKey, Rational.valueOf(15),
  8. QualityKey, 1.0f,
  9. KeyFrameIntervalKey, (int) (15 * 60)),
  10. new Format(MediaTypeKey, MediaType.VIDEO,
  11. EncodingKey,"black",
  12. FrameRateKey, Rational.valueOf(30)), null);
  13.  
  14. WebDriver d = new FirefoxDriver();
  15.  
  16. // Start Capturing the Video
  17. // screenRecorder.start();
  18.  
  19. // Puts an Implicit wait, Will wait for 10 seconds before throwing exception
  20. d.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
  21.  
  22. // Launch website
  23. d.navigate().to("http://cinebels.dnmdigital.com/");
  24. d.findElement(By.xpath(".//*[@id='ban-nav']/li[2]/a")).click();
  25.  
  26. // Mousehover Actions
  27. Actions action = new Actions(d);
  28. WebElement hover0 = d.findElement(By.xpath("//*[@id='head-nav']/li[1]/a"));
  29. WebElement hover = d.findElement(By.xpath("//*[@id='head-nav']/li[1]/div/div/div[1]/h5"));
  30. action.moveToElement(hover0).moveToElement(hover);
  31. action.moveToElement(d.findElement(By.xpath("//*[@id='head-nav']/li[1]/div/div/div[1]/ul/li[1]/a")))
  32. .click().build().perform();
  33.  
  34. //Home Automation page
  35.  
  36. d.findElement(By.xpath("//*[@id='head-nav']/li[3]/a")).click();
  37. //Av Equipment
  38. d.findElement(By.xpath("//*[@id='soln']/div/div/div[1]/a/div[2]/img")).click();
  39.  
  40. //Brands
  41.  
  42. Actions action1 = new Actions(d);
  43. WebElement hoverb = d.findElement(By.xpath("//*[@id='head-nav']/li[4]/a"));
  44. WebElement hoverb1 = d.findElement(By.xpath("//*[@id='head-nav']/li[4]/div/div/div[1]/div[2]/div[1]/ul/li/a/img"));
  45. action1.moveToElement(hoverb).moveToElement(hoverb1);
  46. action1.moveToElement(d.findElement(By.xpath("//*[@id='head-nav']/li[4]/div/div/div[1]/div[2]/div[1]/ul/li/a/img")))
  47. .click().build().perform();
  48.  
  49. //for (int i = 1; i<=links.size(); i=i+1) {
  50. // System.out.println("Name of Link# " + i + links.get(i).getText());
  51. //}
  52.  
  53. File screenshot = ((TakesScreenshot)d).getScreenshotAs(OutputType.FILE);
  54. FileUtils.copyFile(screenshot, new File("D:\screenshots\screenshots1.jpg"));
  55.  
  56.  
  57. // Close the Browser.
  58. // d.close();
  59.  
  60. // Stop the ScreenRecorder
  61. // screenRecorder.stop();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement