Customized Reports for Protractor test - selenium

I am newbie from Selenium to Protractor. I am extensively using well customized reports such as Extent and ATU reports.
But in protractor i don't find anything apart from basic XML and jasmine2HTML. Is there anyone aware of any third party such as Extent/ATU in selenium for protractor?

If you are using Jasmine as your Protractor driver then you can create a custom reporter that does whatever you want.
https://jasmine.github.io/2.1/custom_reporter.html

Related

Fitnesse: integration with Selenium WebDriver

I am working on a Selenium WebDriver project, written using the page object pattern.
I wanted to know whether is there any way in which I can integrate FitNesse and Selenium WebDriver project?
I know FitNesse can be used with Selenium IDE, however, I have no idea whether is it possible to use Fitnesse with WebDriver.
You sure can, it's just Java after all. One example of such a project is (my own set of FitNesse fixtures): https://github.com/fhoeben/hsac-fitnesse-fixtures.
You could use my fixture (BrowserTest) to execute the test. Or only use the web driver setup fixture (selenium driver setup), which also also the setup to be overridden in a CI environment, and do your own thing with web driver in a custom fixture.

Is it possible to use Selenium IDE html test and capture screenshots on failure

I have created a few HTML test suites with Selenium IDE. They are automatically tested and by Jenkins daily. Now, I'm wondering if it is possible to create a screenshot whenever a test fails.
Is it possbile to catch the exeption when the IDE test fails and capture the screen? Or is it only possible with TestNG? If it's only possible with TestNG, how does selenium HTML tests work combined with TestNG?
Kind regards,
Selenium IDE doesn't directly support saving screen shots like this. Check out this other (duplicate) question: Screenshots using Selenium IDE Firefox plugin
selenium ide does not have built in screenshot capabilities, but you can inject raw javascript: "javascript{alert();}" will display an alert. If you can find a way to do it in javascript, you could add the js to selenium ide.

Selenium: Is there any JS (JavaScript) code coverage tool which we can integrate with Selenium Server/RC

Selenium: Is there any JS (JavaScript) code coverage tool which we can integrate with Selenium Server/RC
Hi,
I want to JS code coverage done by my Selenium Test Suite
Is there any code coverage tool which can be integrated with my existing selenium rc framework??
In theory, you can use any coverage tool that instruments JavaScript code to collect coverage data.
For example, you can use JSCoverage either in proxy mode (for real-time instrumentation) or for static instrumentation to run your Selenium tests off the instrumented code.
One technical hurdle could be to devise a way to accumulate coverage data across multiple pages. The coverage tool of your choice could already have support for accumulation of data from multiple page runs. If not, you might have to handle that bit yourself, but this is probably not something trivial.
I have found the solution for my need, there are multiple tools available but I want a tool which can be integrated with my existing automation easily
Tool is JSCover
http://tntim96.github.io/JSCover/
Just run the Server
Run Server
java -cp JSCover-all.jar jscover.server.SimpleWebServer . 8080
Run Proxy Server
java -jar target/dist/JSCover-all.jar -ws --proxy --port=3128 --report-dir=target
Add Proxy in your Webdriver for port specified, 3128 in my case
After execution of test Generate Reports using
((JavascriptExecutor) driver).executeScript("jscoverage_report();");
You can add this line where you exit WebDriver or Test Case
Not aware of a tool for Selenium, but JsTestDriver has a design very similar to Selenium RC (can launch tests from the command line and they are run on a server that drives browsers headlessly) and provides code coverage information.
IntelliJ integrates with JsTestDriver and provides a visual display of coverage information.
Take a look at https://github.com/yui/yuitest/wiki/Code-Coverage
I've integrated this tool in my Selenium tests a time ago. You need a bit of work to gather coverage info before page changes (in any case js trigger a page reload, link etc...)
Once you set up everything, it will fully coverage any js executed while Selenium load and test your website pages.
PS : Even if it was specially adapted for YUI test, you can use it with selenium.
I don't know what you are trying to achieve, but:
Selenium is testing the final output, as seen on the page itself.
So it really does not matter if its PHP, HTML, JSP, ASP or .NET - the Selenium is designed to mimick the end user and click the final application - the final HTML code generated by whatever is under the hood.
Selenium is also not that good for code coverage tests - one piece code can be on many pages - so better approach with selenium is to do the "user" coverage - try to cover all the possible actions which living human could possibly do with your page
There is no particular tool that can integrate with Selenium to do JS coverage. However there are lots of tools which test JS on every page which can tell if the JS that executing on your web page had any errors. This may not ideal solution but on each page you will have the measure of uptil which point JS executed properly on your webpage under test. There are two solutions for that:
1.) JSErrorCollector API: It will integrate directly with Selenium and let you know if there were any error on the page. Can be found at: http://mguillem.wordpress.com/2011/10/11/webdriver-capture-js-errors-while-running-tests/
2.) Full fledged JS coverage tools: There is an excellent list of tools here which will essentially help you in covering JS on on your web pages. Can be found at: JavaScript unit test tools for TDD

How to present a Selenium test written in spec or PHPUnit on Hudson

I am setting up Selenium tests on Hudson and looking for an easy way to present nice results such as Project summary and build summary on Hudson.
Currently I have written Selenium test cases in Rspec and PHPUnit's extension for Selenium (I prefer working on Rspec over PHP).
What is the best way to present detailed report for Selenium tests on Hudson CI Server?
I prefer to use Rspec over PHPUnit. It would be very nice if I can use rspec and still integrate well with Hudson CI Server.
I would very much appreciate for detailed comments.
thank you so much for your help
Best regards
If you have the results as HTML files, you can use the HTML Publisher plugin.
Have a look at a similar question https://serverfault.com/questions/184805/how-to-view-test-results-in-hudson/185027#185027 This guy seams to have integrated the selenium tests into junit and therefore the results can be published using the xunit tests.
There are two selenium plugins, one should work for you.
This I have no idea what rspec is I entered rspec and Hudson into google. The second link was this one http://reprocessed.org/blog/easy_rails_ci_with_hudson It should contain everything you need.

Finding a suitable version of Selenium (automated testing tool)

My project is compatible only with Internet Explorer. I want the test scripts to get generated automatically as it is done in Selenium IDE.Can i use selenium RC to test my application?
I could not use selenium IDE as it can be used only with Mozilla Firefox.
Can you suggest any other free tools for my project.
thanks in advance ...
I think if you dig around for earlier versions of selenium they are compatible with IE. We use it here for front-end automation via IE6 anyway