Skip to main content

Posts

Showing posts with the label getCurrentWindow

Selenium throws an exception when running on Firefox

we get this error when we are trying to run a testng annotated java selenium code on firefox: "[testng] com.thoughtworks.selenium.SeleniumException: this.getCurrentWindow is not a function" Then all the other annotations are SKIPPED. A workaround for such an error would be to put the line of code which gives this error under a try block. In my case it was openReader() I changed the code as below: try{ openReader()} catch(Exception e){System.out.println(e.toString());} The class should throw the Exception too! This solved the problem and after the exception is printed, the execution continues!