Comments (6)
I was also getting same issue . At below line I am getting exception
Screenshot screenshot = new AShot().takeScreenshot(driver,driver.findElement(By.xpath(webElementXpath)));
Exception
`java.lang.RuntimeException: org.openqa.selenium.WebDriverException: unknown error: $ is not defined
(Session info: chrome=66.0.3359.181)
(Driver info: chromedriver=2.36.540469 (1881fd7f8641508feb5166b7cae561d87723cfa8),platform=Mac OS X 10.12.6 x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 0 milliseconds
Build info: version: '3.8.1', revision: '6e95a6684b', time: '2017-12-01T18:33:54.468Z'
System info: host: 'AMD0-SJETHVAN-02.local', ip: 'fe80:0:0:0:144b:ae4a:2606:c0d2%en0', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.12.6', java.version: '1.8.0_121'
Driver info: org.openqa.selenium.remote.RemoteWebDriver
Capabilities {acceptInsecureCerts: false, acceptSslCerts: false, applicationCacheEnabled: false, browserConnectionEnabled: false, browserName: chrome, chrome: {chromedriverVersion: 2.36.540469 (1881fd7f864150..., userDataDir: /var/folders/ym/dtyc5vz9785...}, cssSelectorsEnabled: true, databaseEnabled: false, handlesAlerts: true, hasTouchScreen: false, javascriptEnabled: true, locationContextEnabled: true, mobileEmulationEnabled: false, nativeEvents: true, networkConnectionEnabled: false, pageLoadStrategy: normal, platform: MAC, platformName: MAC, rotatable: false, setWindowRect: true, takesHeapSnapshot: true, takesScreenshot: true, unexpectedAlertBehaviour: , unhandledPromptBehavior: , version: 66.0.3359.181, webStorageEnabled: true, webdriver.remote.sessionid: 3475027cb4404809a4263a44714...}
Session ID: 3475027cb4404809a4263a447145112d
at ru.yandex.qatools.ashot.util.InnerScript.execute(InnerScript.java:32)
at ru.yandex.qatools.ashot.util.JsCoords.findCoordsWithJquery(JsCoords.java:24)
Update
I resolved it using
Screenshot screenshot = new AShot().coordsProvider(new WebDriverCoordsProvider()).takeScreenshot(driver,driver.findElement(By.xpath(webElementXpath)));
from ashot.
use aShot.coordsProvider(new WebDriverCoordsProvider())
from ashot.
Hello!
I have tried to use addIgnoredElement method, and it returned error (screenshot: http://prntscr.com/e9a37q)
I have read some articles about it in your github issues, but there were nothing, about this error in my case with addIgnoredElement. In all other cases it works perfect.
Please help!
from ashot.
any idea why have you closed the issue?
it still fires:
org.openqa.selenium.WebDriverException: unknown error: $ is not defined
Expected:
ru.yandex.qatools.ashot.coordinates..CoordsProvider.Exception: "use aShot.coordsProvider(new WebDriverCoordsProvider())"
from ashot.
Thanks sjethvani & ksiv It worked for me now.
from ashot.
I was also getting same issue . At below line I am getting exception
Screenshot screenshot = new AShot().takeScreenshot(driver,driver.findElement(By.xpath(webElementXpath)));
Exception
`java.lang.RuntimeException: org.openqa.selenium.WebDriverException: unknown error: $ is not defined
(Session info: chrome=66.0.3359.181)
(Driver info: chromedriver=2.36.540469 (1881fd7f8641508feb5166b7cae561d87723cfa8),platform=Mac OS X 10.12.6 x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 0 milliseconds
Build info: version: '3.8.1', revision: '6e95a6684b', time: '2017-12-01T18:33:54.468Z'
System info: host: 'AMD0-SJETHVAN-02.local', ip: 'fe80:0:0:0:144b:ae4a:2606:c0d2%en0', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.12.6', java.version: '1.8.0_121'
Driver info: org.openqa.selenium.remote.RemoteWebDriver
Capabilities {acceptInsecureCerts: false, acceptSslCerts: false, applicationCacheEnabled: false, browserConnectionEnabled: false, browserName: chrome, chrome: {chromedriverVersion: 2.36.540469 (1881fd7f864150..., userDataDir: /var/folders/ym/dtyc5vz9785...}, cssSelectorsEnabled: true, databaseEnabled: false, handlesAlerts: true, hasTouchScreen: false, javascriptEnabled: true, locationContextEnabled: true, mobileEmulationEnabled: false, nativeEvents: true, networkConnectionEnabled: false, pageLoadStrategy: normal, platform: MAC, platformName: MAC, rotatable: false, setWindowRect: true, takesHeapSnapshot: true, takesScreenshot: true, unexpectedAlertBehaviour: , unhandledPromptBehavior: , version: 66.0.3359.181, webStorageEnabled: true, webdriver.remote.sessionid: 3475027cb4404809a4263a44714...}
Session ID: 3475027cb4404809a4263a447145112d
at ru.yandex.qatools.ashot.util.InnerScript.execute(InnerScript.java:32)
at ru.yandex.qatools.ashot.util.JsCoords.findCoordsWithJquery(JsCoords.java:24)Update
I resolved it using
Screenshot screenshot = new AShot().coordsProvider(new WebDriverCoordsProvider()).takeScreenshot(driver,driver.findElement(By.xpath(webElementXpath)));
Your answer really helped me. Thak you..
from ashot.
Related Issues (20)
- Null pointer Exception in ASHOT 1.5.4
- markign differrence with rectangle HOT 6
- Black window appearing in screenshot
- ignore element in current viewport
- Not sure how to use ignore element feature
- How to ignore fixed element when we using shootingStrategy to capturing the entire page. HOT 2
- ignoreElements not working
- Screen shot of an element is white. HOT 1
- withDiffSizeTrigger(int diffSizeTrigger) is nto working HOT 2
- IE11: Full page screenshot not working.java.lang.ArithmeticException HOT 2
- Am too facing this issue, but i can't make above javascript executor logic. As my utility will capture and compare diffrent webpage every time.
- any .net version?
- Is there any support to android espresso/uiautomator, I tried but BufferedImage & ImageIO not supported in android
- Caused by: java.lang.OutOfMemoryError HOT 1
- Caused by: java.lang.OutOfMemoryError: GC overhead limit exceeded HOT 1
- Only able to take a screenshot when using just webdriver. HOT 3
- Is there any support to Karate Webdriver to take FullPage Screenshot? HOT 1
- The full-page screenshot feature is not functioning correctly when capturing screenshot of a websites with a fixed header.... HOT 3
- Need better DiffMarkupPolicy algorithm HOT 1
- Not able to capture screenshot getting error java.lang.RuntimeException: org.openqa.selenium.JavascriptException: javascript error: $ is not defined HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ashot.