Tag Info

New answers tagged


Did you run PageFactory.initElements? The PageFactory magic won't actually parse the annotations until you do so. I usually put into the constructor a line like: PageFactory.initElements(driver, this); So that it runs when I construct the page.


NPE exception comes while some situations are there.Please first avoid this situations. 1) Your browser should be open in screen. You can not minimize while taking screenshot. It is limitation of that. Screenshot captures opened/window display only. 2) Remove turn off display option from sleep mode. While you turn off display you get surely NPE. Because ...


Your screenshot function is creating a new WebDriver instance each time and then taking a screenshot of the default blank page in firefox. You could try passing in your test's WebDriver instance so you get a picture from your test: static public void screenShotOnError(WebDriver driver) { long epoch = System.currentTimeMillis(); String ssTimestamp = ...

Top 50 recent answers are included