Proof of Concept with selenium webdriver - java

What are the parameters to do the POC of the application and making sure it's right candidate for Selenium Automation and then how to begin from there?

If you know your goals, then the issue is to show how Selenium can achieve those goals.
If you don't know your goals, then every tool is the wrong tool until you know what it is you wish to accomplish.
Selenium is good at automating testing of web applications across multiple different web browsers. Some aspects of that testing are better than others, and all of those tests will be written by the testing team that leverages Selenium to verify the application's correct appearance or functionality.
If you have a web application, but don't know how you might test it (possibly because you don't have a test plan) Selenium won't provide a good test plan. It will just provide a set of tools that make some test plans much easier to implement.

I think what business problems selenium solves in that application.

Related

How to integrate selenium and ZAP

I am planning to automate security testing for a web application.
I have the selenium code which is developed using JAVA language, now I need to integrate with ZAP.
Kindly help me how to integrate these two and generate the reports for the same.
You can configure Selenium to use Zap as a proxy. Take a look here for a full solution using WebDriver.io, which is a tiny JS wrapper around selenium. It should give you a high level overview of how to build and run such a solution in the CI. Let me know if you need more help.

Appium vs Espresso for automated testing framework

For last few weeks, I was using Appium(python) for android testing but yesterday we have decided to shift to Expresso(Java) for automated testing. There are couple of reasons why we are making this shift:
We want to scale out our automated testing, and there are lot of features not present in appium.
This is one of the latest testing framework for android, and has nice backward compatibility.
Small API and very easy to customize.
I have been reading for Espresso but I don't find anything great at all, If I compare it with Appium. I am a Python/R developer so maybe there are couple of points I am not able to understand. Would anyone like to help me understand if the shift to this new testing framework will be good for future? I am missing the bigger picture here, and any help would be greatly appreciated.
The Shifting will be very much useful as Espresso supports testing activities outside the app like camera, browser and dialer etc which appium does not support.
Espresso you can test toast message, auto complete and dialogs which are outside app.
With Espresso Test Suit you can find code coverage and measure your testing efforts.
You can go to Espresso if you're sticking only to Android automation and have no idea of automating iOS.
AFIKW, Espresso needs source code of the app in order to automate it.
Advantage is, it's directly open-sourced by google.
But my go is to go with Appium since its a large open sourced community with huge enhancements on its way and easy to automate with any programming language and needless to say it supports both Android and iOS.
I agree that Espresso may be be very efficient when it comes to Android testing solely. For example, it can run only the activity it's testing, which is great.
Still, I stick to the Appium because it has the same API for both AndroidDriver and iOSDriver. Usually Android apps are accompanied by iOS apps, and if you're responsible for the UI automation, you have to take overall costs into account.
Appium has following advantages over platform-specific solution:
Android and iOS tests can share many classes, including helper methods and configuration,
Android and iOS tests can share common tests logic on higher level, while having different or slightly different implementation on lower level (for example sometimes I can just copy whole page object class and make simple change of locators in order to make it work on the other platform),
same API enables us to seamlessly switch between the iOS and Android test development in a team. Easy switching to Selenium for Web development is additional benefit.
The biggest disadvantage of Appium is the speed of longer test scenarios and some difficulties in locating elements, but still it's my choice.
As the side note, I'd like to add that you shouldn't forget about the test pyramid which refers to test automation. Please keep balance between Unit Tests, Integration tests and UI tests http://martinfowler.com/bliki/TestPyramid.html
The main difference between the two is,
Espresso test is within the application and it is aware of all the layers of the application. So you can mock certain layers of app, more like a white-box testing
Appium tests are black-box, tests know only the UI layer of the app. Main advantage is for cross-platform testing.

Advice with Selenium Project

This is a Java - Selenium ( any other related technologies ?) project I need to do on the side for a friend, who volunteers at a non-profit organization. I am supposed to create an application to test their web pages. I am more into the server side of java, c, c++. My question is what are the open source technologies and frameworks available which will help me to build a robust test framework, I need to create a process for them, so that any future volunteers with basic knowledge of java and selenium can maintain, add new test cases as and when necessary. I read a little about TestNG but now sure that it is the best out there.
Please suggest best practices for building a java selenium test framework
Use Selenium 2/WebDriver as the browser automation tool
Geb + Spock if you can use Groovy otherwise JUNIT + PageObject pattern
If this is just a simple homepage without many Javascript, I recommend HTMLUnit since it's faster than Selenium. But you might be interested in Cuke4Duke for BDD style.
https://github.com/cucumber/cuke4duke/tree/master/examples/java-webdriver
Junit or TestNG is good choice for using with selenium RC. 1st you should explore ide then go for selenium RC. One good Example is available at http://www.dev2all.com/articles/

JSF unit testing

I'm trying to find a practical unit testing framework for JSF.
I know about JSFUnit, but this is very impractical to me. I need to include about 10 JARs to my project, and jump through many other hoops just to get it running.
I realize that -- due to the need to simulate a platform and a client -- unit testing web applications is difficult. But is there a better way?
Have you thought about doing integration testing with Selenium or another tool? Selenium allows you to record and run tests directly in the browser. You can also run tests in multiple browsers and on multiple platforms with Selenium Remote Control.
Writing unit tests is good, but it might provide more to create some functional integration tests rather than unit-testing the presentation layer code.
On the project I'm working on at the moment we dabbled with using selenium. We actually spent a lot of time writing these selenium tests, but found that they added little value because the UI changes so much and you just end up doubling your effort for very little return on investment.
Another problem with selenium is that it requires your code to be deployed, which means it doesn't play well with unit test frameworks eg maven.
What I would say is that writing really good unit tests for your managed beans is invaluable.
Have you taken a look at the jsfunitwar Ant task or alternatively the Maven plugin provided by JSFUnit? Both greatly reduce the complexity of generating the .war file to be tested. I'm using JSFUnit on my current project and find the combination of white box and black box testing capabilities to be very powerful. Because JSFUnit uses HtmlUnit under the covers, you can very easily and effectively examine the generated HTML, or conversely, verify the state of your internal JSF backing beans. I was able to incorporate the JSFUnit tests into my Continuous Integration process and have been quite pleased with the outcome.
HttpUnit can also be an alternative. It provides apis so you have a choice to automate the tests.
http://httpunit.sourceforge.net/index.html
Selenium is superficial, jsfunit is inward. I recommend that use jsfunit if project is not simple. Because team member can change jsf managedbean names or etc, you can catch that with jsfunit.
I'm with Paul on Selenium being very easy to setup and start working with. I use Selenium IDE in Firefox with some customization at that level, then you can export these to other platforms such as Java JUnit tests. It was quite easy to download and launch the selenium-server.jar, add the selenium-java-client-driver to my existing Eclipse Maven POM driver project; then launch the same exported JUnit test in Eclipse. I mainly wanted to use Java just for looping which the basic Selenium IDE didn't support.
I have configured JSF Unit for my project too which does require more time to configure... more importantly though with in-container tests like JSFUnit changes to the test require rebuilding the WAR, redeploying in the container and then executing from Eclipse or via a browser. So for quickly trying a small change this is time consuming. Of course with JSFUnit you have access to all the internals of the JSFSession etc so it depends what granularity of testing you need I guess.
I'd be interested if anybody knows a faster way to turnaround changes to a JSFUnit test and execute it. Definitely Selenium tests feel more like JUnit tests in that regard.

How to conduct blackbox testing on an AJAX application?

What's the best, crossplatform way to perform blackbox tests on AJAX web applications?
Ideally, the solution should have the following attributes:
Able to integrate into a continuous integration build loop
Cross platform so I you can run it on Windows laptops and Linux continuous integration servers
Easy way to script the interactions
Free-as-in-freedom so you can adapt it into your tool chain if necessary
I've looked into HttpUnit but I'm not conviced it can handle AJAX-heavy websites.
Selenium might be what you're looking for: http://selenium.openqa.org/
It allows you to script actions and evaluate the results. It's open-source (Apache 2.0), cross platform, and has nice tools.
I have used Selenium for exactly this task, but found it to be brittle.
Check out this talk by two Googlers: Does my button look big in this? Building testable AJAX applications
They isolate the testable javascript (non DOM-interaction) and test that using the Rhino javascript engine.

Categories