Create screenshot of the page with Watin-like tool - testing

I need to create a screenshot of the page by providing a page URL to the command line tool. I found the following application: Convert HTML To Image. This tool is OK but want a more flexible application. I need to have ability to perform the following:
Go to the following page.
Click button.
Take a screenshot and save it.
I want to create an application that will test a site by going by URL, take a shots, and then send the images to the email.
Does anybody has an experience in solving such problems?

Watin can capture screenshots:
ie.CaptureWebPageToFile("c:\tmp\watin main page.jpg");
More info:
http://watin.sourceforge.net/releasenotes-1-2-0-4000.html
http://fwdnug.com/blogs/ddodgen/archive/2008/06/19/watin-api-capturewebpagetofile.aspx

I am a contributor to the WatiN project and the author of the WatiN Test Recorder. To do what you want, I'd suggest using something like csExWB2 (http://code.google.com/p/csexwb2/). The demo will give you the basic browser, and you can add screen shots where you like. Emailing is not covered, but that should be fairly easy.

I know this is very old post but i want to leave a message for visitor of this post.
PhantomJS is one option (http://www.phantomjs.org).

According to the WatiN features page:
Supports creating screenshots of webpages
I would direct you to more specifical documentation, but the documentation web doesn't work well with Firefox, so I can't search it.

Related

I need some help on creating an automation script using Github as my "playground"

I've been doing a lot of selenium practices lately. However, I haven't been able to create an automation script that would allow me to create a new gist on github. To those of you who are familiar with gist on github, on https://gist.github.com/, there is a big Text Area that would allow the user to type in the code. I've tried using xpath to no avail. I've also made sure that I use the latest version of geckodriver and .jar. Using cssselector also didn't work. From what I've discovered, there are tons of divs on that Text Area. To make things short and simple, how do I create an automation script for that big text area?
screenshot of https://gist.github.com/
it use CodeMirror text editor, try executeScript with the code below
document.querySelector('.CodeMirror').CodeMirror.setValue('Hello World!')

Can i get screenshot of desktop using vuejs

i am working on tracking app using vue.js. I am a new developer.i wanna know is it possible to track mouse click and capture screenshots even if person is on desktop or any where else on browser
This has nothing to do with VueJs specifically. However, you can use HTML5/Canvas/Javascript to take a screenshot, but that's still experimental.
Take a look at this answer: Using HTML5/Canvas/JavaScript to take in-browser screenshots
i have found the solution
i followed the steps here
https://www.webrtc-experiment.com/getScreenId/
these steps allowed me the screen sharing on my webpage and then i use html to canvas to get the image of the video tag

simulating file download with selenium on chrome browser for element with reactid

I need to simulate file download on chrome browser and below links points to solutions which is what I'm looking for.
http://ardesco.lazerycode.com/index.php/2012/07/how-to-download-files-with-selenium-and-why-you-shouldnt/
https://github.com/Ardesco/Ebselen/blob/master/ebselen-core/src/main/java/com/lazerycode/ebselen/customhandlers/FileDownloader.java
I'm not able to use this code as it requires attribute and in my case button has a reactid which triggers a end point call. Please refer to attached screen shot.
Can somebody please tell what changes I need to do to make code in above links work ?
Thanks in advance.
Regards,
Vikram
To be able to download a link to need to find a way to get the link. The best way to do that is to talk to the developer that wrote the code and find out how it works.
Clicking on the button will trigger some sort of JavaScript event, you need to know what that event is so that you can replicate it to get the download link.
Bear in mind that this is probably not a test that's worth performing in Selenium., it's probably a unit test in JavaScript land.
Since you can't get the link of the downloadable file from the html and verify the https status code because in your case - the downloading happens by javascript method
The only way to verify downloading in your case is to actually click the element and verify that the file was downloaded.
You also need to set the capability in ChromeDriver to download to default directory without asking.
Chrome Web Driver download files

Post Screenshot of APP to wall

How would I make a button that when clicked the user of the app will be posting a screenshot of the canvas page they are on and have it posted to their wall? And maybe add some comments with it as well.
you would have to require the user to add some additional plugin to their browser. There are many plugins that do this - for example clipboard.com provides this functionality.
To the best of my knowledge, these extensions actually make a request themselves (in the back-end) to the url you are currently on and takes the screenshot from that url on the actual server. From there it can be shared and commented on.
However with out some external utility I don't think this functionality is possible.
hope this helps...

Using Titanium.Platform.takeScreenshot

I'm evaluating using Titanium for a project that makes videos from browser based animations. I was hoping for a way to take screenshots from within the app for each frame. The documentation of takeScreenshot seems a little slim so I was hoping to ask before I build a prototype.
Does take screenshot get the full document, or just the visible content?
Does the screenshot include window chrome?
Someone from titanium QA was able to answer the question. takeScreenshot actually takes a screenshot of the whole desktop.