Guest User

Untitled

a guest
Nov 17th, 2017
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. static void Main(string[] args)
  2. {
  3. IWebDriver driver = new ChromeDriver();
  4. try
  5. {
  6.  
  7. driver.Navigate().GoToUrl("http://www.google.com");
  8. IJavaScriptExecutor js = (IJavaScriptExecutor)driver;
  9. js.ExecuteScript("window.print();"); //this is the line that throws the error
  10. }
  11. catch (WebDriverException ex)
  12. {
  13. //just eat the error here since it's done opening the pdf viewer
  14. }
  15.  
  16.  
  17. //cannot execute the line below because the driver is dead in the water at this point - anything I try to do with it just times out...
  18. var q = driver.FindElement(By.XPath("descendant::input[@class = 'q']"));
  19. }
Add Comment
Please, Sign In to add comment