Showing posts from April, 2013

Free Testing E-books

Here is a list , that has good testing ebooks; you might want to read :


Selenium WebDriver Example / Sample test application - Learn Selenium / Learn WebDriver

For all the newbies who are trying to learn selenium there are very few examples except for this one.
If you already know how to configure eclipse and webdriver then you are reading the right post.
For those who want some info on configuring eclipse - check this earlier post.

The best thing I could think of was automating my own blog as an example.
Here are the steps:
Launch the browserNavigate to http://go-gaga-over-testing.blogspot.inIn the customized google search field type "Selenium"Click on searchValidate the search results are displayed Close the browser Create a new package
Create a new class under that
Now you can either record using selenium IDE and Export the test case as JUnit 4 (WebDriver) and save the file as as a "".java or use any tool (Six tools for Selenium Object Identification) to get the object properties to directly use in the webdriver test case.

So we are all set to start coding

This is how the raw test case would look like:

package testSelen…

UnreachableBrowserException: Error communicating with the remote browser. It may have died !

So this is something I learnt the hardway , all of a sudden the selenium scripts throw an error: org.openqa.selenium.remote.UnreachableBrowserException: Error communicating with the remote browser. It may have died.
I am not sure which one might work for you but I am sure things that will not work: 1. Upgarding firefox or any browser 2. Adding/Deleting the jar files 3. Changing the driver to instantiate the browser 4. Killing or trying to find orphan processes
Solutions: Cherck for compatibilty of browser with seleniumMake sure that there are no warnings in your code  Open the browser (in my case firefox)
Go to the address bar and type about:config
Right-click and create a new boolean value
and name its as extensions.checkCompatibility.19.0
Set this value to false
restart the browser Make sure you update the objects properties 
Finally also be sure that you check different websites and objects!
Happy Coding...

Skillset - WebDriver Automation Engineer

Note: the Skillset category is just to gauge where you stand in terms of the skills required for the role

This is a full life cycle testing assignment for a Technical (Software) Test Analyst with experience automating Testing for Web applications using the Selenium WebDriver product. We need people that are comfortable coding their own scripts using Ruby, but if you’ve only used Java, here’s your chance to learn!

It’s an agile environment too using BDD and TDD techniques, so experience using cucumber, RSpec frameworks are used quite extensively here.

Because of the close and intimate working relationship with the stakeholders, candidates must have excellent English communication skills and be able to confidently refine requirements and collaborate with users to find solutions to difficult testing requirements.

Selenium WebDriver - launches firefox with IE tab options

So you are trying to do the most basic thing : launch firefox

Webdriver driver = new FirefoxDriver();

Firefox browser does open up, but in the foreground IETab+Options tool bar keeps popping up.

You repeat the steps manually and nothing!

How will you disable this add on so that a blank clean browser opens up in FF?

What you need to do is to launch your default profile when launching Firefox.

ProfilesIni profile = new ProfilesIni();

FirefoxProfile ffprofile = profile.getProfile("default");

WebDriver driver = new FirefoxDriver(ffprofile);

These generally require the following imports:

import org.openqa.selenium.firefox.FirefoxProfile;

import org.openqa.selenium.firefox.internal.ProfilesIni;

Happy Learning!

If this does not work then create a new profile , disble the addon IETab and save the profile
ProfilesIni profile = new ProfilesIni();

FirefoxProfile ffprofile = profile.getProfile("SeleniumProfile");

WebDriver driver = new FirefoxDriver(ffprofile);

Screenshots on VM with QTP

I am sure a lot of you have noticed that taking screenshots on a VM will result in a blank screen :)

The solution is that the machine should not be locked while running your scripts , similar to a solution provided in my earlier posts.If you missed that out here is the code:

Content of vbs File (keykaker):

' Keyboard activity faker
Set shell = WScript.CreateObject("WScript.Shell")
Set args = WScript.Arguments
interval = 180
key = "+"
output = True

' If running under WScript were not in a console so disable any output
If InStr(LCase(WScript.FullName), "wscript") > 0 Then output = False
' Handle the arguments
If args.Count > 0 Then
temp = args.Item(0)
If Not IsNumeric(temp) Then
WScript.Echo "Interval must be numeric"
WScript.Quit 1
ElseIf temp < 1 Then
WScript.Echo "Interval must be greater or equal to 1"
WScript.Quit 1
interval = temp
End If
End If
If args.Count = 2 Then
key = args.Item(1)
End If
' …

WebDriver java concepts - Private final static / public, default, protected, and private / Abstract / Interface / Final / Super / this

Continuing the WebDriver java concepts category here are a set of simple yet complex terminologies used in webdriver frameworks wrt Java:

Private final static attribute vs private final attribute -

Static means "associated with the class"; without it, the variable is associated with each instance of the class. If it's static, that means you'll have only one in memory; if not, you'll have one for each instance you create. static means the variable will remain in memory for as long as the class is loaded; without it, the variable can be gc'd when its instance is.
In general, static means "associated with the type itself, rather than an instance of the type."

That means you can reference a static variable without having ever created an instances of the type, and any code referring to the variable is referring to the exact same data. Compare this with an instance variable: in that case, there's one independent version of the variable per instance o…

Learn Selenium the right way

So most of my fellow testers and newbies to testing agree that learning selenium isn't all that easy especially if you have been using either QTP or any other tool that uses simple scripting (Compared to any scary code that has a lot of complex jargons) To make things easier and less complicated for all of whose mails and messages I get on linked-in / facebook and the blog. I have chalked out a simple and strategic set of things to learn and If you go about this(I would say 15 day schedule) then you are ready for any god damn Selenium Code!
Of course we will choose Java as the language of choice:
Java Introduction and Concepts First Java programConcept of class filePlatform independenceDatatypes in JavaString classIf statementsWhile LoopFor LoopsSingle/Two Dimensional ArraysFunction Input ParametersFunction Return TypesOOPS Concept's 
Local/ Global VariablesStatic and Non-Static VariablesStatic and Non-Static FunctionsObjects in JavaCall by reference and ValueConstructorsInherit…

Tabelize it - Create tables in blogger!

Trying to create tables in your blog posts , here is an easy way:

A quick tool for creating HTML tables out of spreadsheet data

WebDriver Java Concepts - HashMaps

So a lot of automation engineers I know have started to venture into the world of Selenium WebDriver. Looking at this I will now start a series of posts that will be tagged as "WebDriver Java Concepts". The intention will be to add concepts of Java and WebDriver that a newbie should learn.

To start with one of the most popular concepts that is used in Selenium frameworks:
HashMap - Hashmaps in simple terms are nothing but key value pairs just like the object dictionary that we have in QTP. A more technical definition would be that "The HashMap class uses a hash table to implement the Map interface. This allows the execution time of basic operations, such as get( ) and put( ), to remain constant even for large sets."

Points to ponder:
The HashMap class is roughly equivalent to Hashtable, except that it is unsynchronized and permits nulls.The HashMap class supports four constructors.The first form constructs a default hash map: HashMap( )The second form initializes t…