Take screenshot specifies element in Javascript?
I create test for my webpage in nodejs.
I want to save 1 image in my local website and convert it to base64 and save in mongodb.
I'll research all internet, I find almost is C# and Java code but I can't convert it to Javascript.
Present, my code can Takescreenshot all webpage but I want it capture only 1 element like image with id or class.
Thank you.
most drivers do not yet support element screenshots see #912
but the API should exist in javascript, will leave this bug open to implement that in webdriver.js for the WebElement class.
Sorry, I don't know. This mean is can't takescreenshot specifies Element in Javascript?
If it can takescreenshot 1 element, you can example in javascript code?
The python different with javascript. Python or other langues in client is get support much javascript.
I'm using node.js. Anyway to capture 1 element? I'm was using WD and PhantomJS but it not success. Because my auto test go in sequence step by step.
Almost other library can do this, but it's not combined with selenium. Because it using other get image, but my image change random in 1 session. If it go to url like selenium image will change.
Thank you.
Can anybody help me? Thank you.
stackoverflow.com is usually a better place for questions. Issues are more for bug reports and feature requests.
@vanloc0301 This has not been implemented in phantomjs. You will need to raise a bug there for them to implement takes element screenshot.
You might wan tot try to define the co-ordinates for your element. More details can be found here:
https://groups.google.com/forum/#!topic/selenium-users/7wHF0nGuOV0 https://groups.google.com/forum/?fromgroups=#!searchin/selenium-users/image/selenium-users/8atiPIh39OY/S2NVGiKQbuYJ
Best, Jigyasa 2122888978 https://www.linkedin.com/in/jigyasa1
Forgive Typos. Sent from my S4
On Tue, Aug 25, 2015 at 3:02 AM, David Burns [email protected] wrote:
@vanloc0301 https://github.com/vanloc0301 This has not been implemented in phantomjs. You will need to raise a bug there for them to implement takes element screenshot http://w3c.github.io/webdriver/webdriver-spec.html#take-element-screenshot.
— Reply to this email directly or view it on GitHub https://github.com/SeleniumHQ/selenium/issues/958#issuecomment-134504870 .
Thank you very much. @jigyasa-at-git . But almost only support in C#, Python or Java. In javascript is not support select element. @zoechi I was ask in stackoverflow.com but everybody example with C# or Java. @AutomatedTester . Thank for reply.