Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- static void Main(string[] args)
- {
- IWebDriver driver = new ChromeDriver();
- try
- {
- driver.Navigate().GoToUrl("http://www.google.com");
- IJavaScriptExecutor js = (IJavaScriptExecutor)driver;
- js.ExecuteScript("window.print();"); //this is the line that throws the error
- }
- catch (WebDriverException ex)
- {
- //just eat the error here since it's done opening the pdf viewer
- }
- //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...
- var q = driver.FindElement(By.XPath("descendant::input[@class = 'q']"));
- }
Add Comment
Please, Sign In to add comment