Posts

Showing posts from April, 2013

Free Testing E-books

Image
Here is a list , that has good testing ebooks; you might want to read :   http://www.ministryoftesting.com/resources/ebooks/ Source:   http://www.ministryoftesting.com/

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

Image
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 browser Navigate to http://go-gaga-over-testing.blogspot.in In the customized google search field type "Selenium" Click on search Validate 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

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

Image
    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 selenium Make 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

Image
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

Image
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 =

Screenshots on VM with QTP

Image
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 Else interval = temp End If End If If args.Count = 2 Then key =

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

Image
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 variabl

Learn Selenium the right way

Image
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 program Concept of class file Platform independence Datatypes in Java String class If statements While Loop For Loops Single/Two Dimensional Arrays Function Input Parameters Function Return Types OOPS Concept's  Local/ Global Variables Static and Non-Static Variables Static and Non-Static Functions Obj

Tabelize it - Create tables in blogger!

Image
Trying to create tables in your blog posts , here is an easy way: A quick tool for creating HTML tables out of spreadsheet data http://tableizer.journalistopia.com/

WebDriver Java Concepts - HashMaps

Image
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