Posts

Showing posts from February, 2014

JBehave Mindmap

Image
A follow-up to the previous post here is a mind map that I had created sometime back.

Though I will not say that this is the best one out there, this for sure helps me to understand how stuff works:

Let’s explore and learn JBehave !

Image
I have off-late been doing a lot of BDD and have never written a single post about the same. There is so much about this on web that I really never felt to clone the information. The reason I decided to write this post is to help all of them who have been asking me - how to join the JBehave bandwagon of testing using BDD approach?
Start by reading this - http://jbehave.org/reference/stable/tutorials.html
Let’s get into the meat of what it takes to learn JBehave. JBehave + Selenium +Java +Maven
Installations: 1.JDK6+ a.Download JDK/JRE Portable Zip from here http://staticchaos.freeoda.com/java/ b.Set environment variables (system ) – JAVA_HOME e.g.: JAVA_HOME=C:\Program Files\Java\jdk1.7.0_10 c.Add to Path variable - C:\Program Files\Java\jdk1.7.0_10 \bin\; C:\Program Files\Java \ jdk1.7.0_10\jre\bin d.Add to CLASSPATH a dot "."and e:\jdk7\jre\lib\ext 2.Maven 2+ a.http://maven.apache.org/download.cgi#Installation b.Unzip the distribution archive, i.e. apache-maven-3.1.1-bin.zip to …

GUI for Selenium Grid

Image
Information on VisGrid (a GUI for Selenium Grid. You can start hub, create and attach a Selenium node very easily and quickly)


Source: http://www.codoid.com/products/view/2/30

Encode Password using Base64 Java - Selenium Webdriver

Image
One of the most common practice while automating websites which have passwords and other personal information  is encoding.

Base64 is a method of encoding every 3 bytes of input into 4 bytes of output; it is commonly used to encode photos or audio to send in emails, and a way to hide webpage authentication from casual snooping. Here is an example of how to code a Base64 encoder in Java for Selenium WebDriver:

 import.org.apche.commons.codec.binary.Base64

WebDriver wd = new FirefoxDriver();
WebElement pwd = wd.findElement(By.id("passwd"));

byte[] encodedBytes =Base64.encodeBase64("TextforEncoding".getBytes());System.out.println("encodedBytes "+newString(encodedBytes));byte[] decodedBytes =Base64.decodeBase64(encodedBytes);System.out.println("decodedBytes "+newString(decodedBytes));Happy Encoding!

Quick way to generate test data

Image
Simply visit the web page www.generatedata.com and quickly create test data in various formats like Excel, CSV, XML, JSON, HTML














Note: Ensure that that you select the correct Export Type tab before hitting the Generate button
Advantages: Easy to use GUI interface Provides support to create data with custom XML and HTML structure Allows for conditional data generation like generate date within specific range etc Provides built in data type and support for different date format
Disadvantages:
Allows for max 100 rows of test data row to be created in one go.


Happy Test data generation!

How to change QTP / UFT Insight image during execution?

Image
If you have started using UFT then I am sure you would have at-least given this feature a try:

UFT Insight = Image based identification

 Mandatory /assistive/smart identification does not work in Insight
Ordinal /Visual relation identifier do


Insight objects contain the image either internally (when created during record or learn) or by supplying an image using the ImgSrc property
Descriptive programming:
InsightObject("ImgSrc:=C:\Image.jpg").Click InsightObject("ImgSrc:=C:\Image.jpg").Click
SetTOProperty:

InsightObject.SetTOProperty "ImgSrc", "C:\Image.jpg" InsightObject.Click

Options for Insight Object are at Tools>Options>GUI Testing>Insight. This pane enables you to define options that customize how UFT handles Insight test objects


Hope you got enough insight, Happy Testing!



QTP 11.5 -> UFT

Image
It's been sometime now that I have blogged. Too many projects and automation tools giving a good start to my 2014.

Back to the original topic of what's in it for me with UFT?

If you really do not want to  RTFM here you go:


Here is what HP had to say way back in 2012/early 2013:
"It's time to bring much awaited HP Unified Functional Testing 11.5 (QTP + Service Test = UFT) has been released today (Dec 06, 2012) at HP Discover 2012 event"

As you would have guessed it the new version of HP QTP which is being called HP Unified Functional Testing 11.5 (UFT 11.5). UFT 11.5 is actually a combination of HP QTP (for testing GUI - Vbscript) and HP Service Test (for testing API/web services - C#).New modern unified IDE aligned with modern IDEs (like Eclipse) / have many new features such as script editing, coding, MDI, checkpoints, auto completion etc Image Based Automation – Using HP UFT Insight  (Not very successful but is a good last resort)Integration with Open Source CI…