AutoTestWebDriver driver=new AutoTestWebDriver(); Screen shot for full page works. This is my code:
WebElement element = driver.findElement(By.id("element"));
Screenshot shotFullscreen = new AShot().takeScreenshot(driver);// works fine
Screenshot shot = new AShot().takeScreenshot(driver,element);
this is the error I get:
org.openqa.selenium.WebDriverException: unknown error: $ is not defined
What can be the issue?
I solved it like this: Screenshot screenshot = new AShot().coordsProvider(new WebDriverCoordsProvider()).takeScreenshot(driver,driver.findElement(By.xpath(webElementXpath)));
(You need to specify which implementation to use -the WebDriverCoordsProvider or the JQuery one).