My Blog List

Thursday, December 29, 2011

Test Management Tool Integration

Lot of testers are involved in integration of test management tools with automation tools to read and execute the cases and finally updating the results back to test management tool. 
Here are the some info.


The below link will help you to integrate HP Quality Center with other tools
http://qtpcodes.blogspot.com/2011/10/retrieve-values-from-quality-center.html


Integrate Test Link with other tools
---------will continue here....

Tuesday, December 27, 2011

Java - Technology and API Overview

Java UI Technologies:
Java AWT
Java Foundation Classes(JFC)/Swing 
Java SWT
JavaFX
JavaServer Faces (JSF)


Java Server-Side Technologies:
Java Servelets 
JSP (Java Server Pages)
Enterprise Java Beans (EJB)
Apache Struts
Apache Spring


Java Communication Technologies:
Java Message Service (JMS)
JavaMail API - for Mail purpose


Data Access Technologies:
JDBC 
XSSF - API used to access Microsoft office products
Java Hibernate - API used for Object/Relation data mapping.


Still continues here...





Monday, December 26, 2011

WebServices and Related Terms

In today's world, daily everyone is hearing terms like Web Service, XML-RPC, SOAP, SOA etc. So what are these things? Where we are using? How this is helpful in software applications?
Let's start a simple discussion here.


WEB SERVICE:
A webservice is nothing but some piece of software over internet / intranet without UI.
For example, I need a method to add 2 numbers. So I am developing a method "addNumbers" locally. But this method is in our local code and its complied as exe or JAR file, no others can use it if anyone wants the same functionality. 
If I published this method in common repository, anyone can use by knowing this method signature and how to access them. This is webservice. 
- WebService can be published on internet or intranet. 
- Its language independent. ie. WebServices can be written in any language and accessible from any language.
- Platform Independent ie. published on any webserver and accessible from any OS.
- No need of UI technologies, only service through TCP/IP over HTTP.
Ex.
Displaying weather reports on different sites, World Clocks, etc.


COMPONENTS OF WEBSERVICE:
There are 3 components which are making a webservice.
1. Service Provider
Service Provider is a WebService published on internet or intranet to access from public.
Ex. PayPal Gateway


2. Service Consumer
Service Consumer is service which is requesting to access the published webservice.
Ex. Any Train, Bus booking site


3. Service Registry
Service Registry is nothing but a WebServer or Web Application server in which we will publish our WebServices to reside.
Ex. Servers like IIS, TomCat, etc.


Then, What is XML-RPC, SOAP, WSDL, UDDI, SOA?
For any WebService we need 3 tasks like data transmission, then some task to describe our webservice to access from public and then some task to make our Webservice discoverable, how to discover etc from public.


Message Formats:
Currently developers are using XML based data formats majorly. So these kind of messages are transported over HTTP (Also we can do over SMTP or FTP)
1. XML-RPC (XML based Remote Procedure Call)
This is pure XML format message which will be sent to access a WebService and again the response will come  in XML format.
2. SOAP
This is another format based on XML structure. SIMPLE OBJECT ACCESS PROTOCOL is a custom message format to send request for a webservice and reponse also will co,e in SOAP format.
3. JSON
JavaScript Object Notation is also another message format in name-value pairs. Its rising today as it is easy of use format interns of code.


Description:
This is the way to describe our published webservice like API method name, parameters etc.
1. WSDL
Web Service Description Language is used widely to describe any webservice. This .wsdl contains your method signatures. This WSDL is developed by MicroSoft and IBM.


Discoverable and Discovery:
This is the way to make our webservive discoverable across public and how to access this webservice.
1. UDDI
Universal description and discovery Integraion is used widely to publish Webservices through publish and find mechanisms. Its a public webserver where you can deploy your webservices. Normally gov sites will use more.


Then, SOA is a wide topic to design applications. Service Oriented Architecture design is a approach where business functions of applications are designed as webservices and UI is used to represent the data only. (Just like database driven applications where stored procedures will do all functions and UI is used to display the data and interactions.)


So normally, for these kind of applications QA people will do lot of WebServices testing and minimum level of testing from UI.

Thursday, December 22, 2011

JMeter - Beginner's Tutorial

This is a basic tutorial explains how to start with JMeter and how to use for basic load testing. Also it covers a flow which is mostly used across industries.
You can get lot of clear help here. JMeter Help

JMeter supports HTTP, HTTPS, FTP, SOAP and LDAP and it can be Integrated with selenium to do extensive use. Here are the flow to start your Load Testing.


Creating Tests:
1. First, Add Proxy (Under Workbench >> Non-Test Elements). This Proxy only acts as a recorder.
So don't forget to start the proxy before recording. Also after finished recording, stop the Proxy.


2. Add Controller. (Under Workbench >> Logic Controllers >> Simple Controller). This Controller is nothing but a container(mainly used for grouping). Inside a controller you can have your requests. ie. Transactions


3. Now record your transaction and drag it under your controller.


4. Add ThreadGroup (Under TestPlan) and group the recorded requests(or controllers) under thread group. Its for grouping set of controllers to run. ThreadGroup will contain users, ramp up and etc which are used to virtualize load while running.


5. Add listeners. (Workbench >> Listeners >> Assertions >> Comparison Assertion Visualizer). Listeners are needed to RUN, otherwise you can't view the results. Listeners are like runner here. You can select any kind of listener based on requirement.
Comparison Assertion Visualizer  -- will show results pass or fail for each request.
Save Response to File  -- will save response to external html file.


Assertions:
6. Add assertions for specified request. (Ex. Response Assertion is used to verify some text is present or not).
That's all. Now script is ready. So lets start your load test now.


Running:
1. Go to your Thread Group
2. Set No.Of. Threads(Users)Ramp Up Period and Loop Count.
3. Start Run and see the results on your listener.


Data-Driven:
We can feed data from CSV file or extract data from previous response and feed that to a request.


7. We can feed data from CSV file.
     - Just keep a CSV file with only data but not with column names.(separated by any delimiter)
     - Add "Config Element >> CSV Data Set Config"
     - Set FileName and ColumnNames (CSV contains no column names, just data. So you need to mention your column names ie.Variable Names here separed by delimiter)
     - On Request, Pass value as ${VariableName} ie. Column Names specified in above step.


8. Data Correlation ie. Extract data from previous page's response and put it as data for next request or page transaction.
    - Do "Listeners >> Save Response to file" for previous request.
    - Then find the format of expression in response for the part containing our data to be extracted.
    - Then on the request, add "Post Processors >> Regular Expression Extractor" to extract the data.
    - Set Reference Name, Expression (like productID=(.*?) ) and template as $1$ (template is used to extract multiple values. Here going to extract 1 string only. If its two values, then $1$$2$)
   - Then for the next request, set this reference name as value like ${refName}

Hope this discussion will give you some idea on how to work with JMeter !!!

Wednesday, December 21, 2011

Cloud Computing Vs SaaS, PaaS and IaaS

Lot of peoples have some confusions about what is Cloud? If so then what is SaaS?
I will discuss about this topic with information I have.


Basically Cloud Computing refers some computing operation over internet, it may be any kind of service. Under this we have different models according to industry requirements. They are,
  1. Software as a Service
  2. Platform as a Service
  3. Infrastructure as a Service
Software as a Service - SaaS:
 SaaS refers simply access to an software application via internet on our client browser or any kind. It may be any kind like hosted in own environment or hosted in third party environment. 
Its related directly to end users.
Ex. Gmail, Google Docs etc.

Platform as a Service - PaaS:
PaaS refers access to a platform that provides capabilities to develop and test software applications via internet.
Its related to developers and testers who creates the software application.
Ex. Force.com(by SalesForce.Com), Google App Engine, Windows Azure, etc.

Infrastructure as a Service - IaaS:
IaaS refers access to hardware like mail servers, web servers etc via internet.
Its related to IT persons(or Organizations) who is responsible to provide environment for developers and testers to make software application.
Ex. Amazon EC2, Database.com(by SalesForce.Com), RackSpace, etc.


Hope this article will give you some ideas !!!

Monday, December 19, 2011

Mobile Testing - Kinds of testing carried out on a Mobile app

In today's world, without mobile (especially Smart Phone) nothing moves for every one. As mobile phone users are growing well, mobile market is on the boom. Obviously Mobile testing is an important area for today's software testers.
So how to start mobile testing? What kinds of testing will be carried out on a mobile application?


Basically 4 types of mobile application is there.
1. Native application (Installable / Un-Installable)
2. Native application (Not Installable / Un-Installable, comes with device)
3. Web application (optimized with m.domain.com)
4. Applications work using WAP


So, have to execute many type of testing based on the application area, domain etc. This document will give you all kinds of testing. You can execute all or selective tests for your mobile application.
http://unifiedtestinginitiative.org/files/utc_android_v1.pdf


As we know, lot of automation tools supporting mobile testing. Something,
1. QTP
2. TestComplete
3. SeeTest Studio
4. Keynote DeviceAnyWhere
5. TestDroid by BitBar
6. M-eux by Jamo Solutions (Add-On for QTP, Visual Studio and Eclipse)
7. iPhoney
8. iPad Peek etc.
9. Selenium with FoneMonkey by gorilla
10. Selenium android driver
11. Perfecto Mobile providing some solutions
You can look here for more. More mobile testing tools


Lot of frameworks and approaches are followed in today's world to carry effective automated mobile testing on android, iOS, Blackberry, Windows Mobile OS, etc. 
For Android,
1. Selenium android Webdriver - OpenSource and works with ADT plug-in for eclipse
2. Robotium - Opensource and have extra features for mobile testing. We can also use ADT plug-in here.


Also I want to list some discussions which will give you real time problems on mobile application.
http://qatestlab.com/pressroom/qa-testing-materials/testing-techniques-for-mobile-applications/
http://www.sqaforums.com/showflat.php?Cat=0&Number=641518&an=0&page=0&gonew=1#UNREAD


Hope this will give you some ideas to start !!!

Friday, December 16, 2011

Continuous Integration vs Version Control

Most of new techies have a doubt on What is Continuous Integration? and What is Version Control? What's the relation between them? 
I want to explore and discuss something about this topic here.


Actually Continuous Integration(CI) is more than Version Control (VC). Version control is simply for maintaining different version of docs or files while users committing changes to common repository. But CI is far more than that. CI is fully related to automation  o application build and deployment activities.


Continuous Integration:
CI is a system which is used t automate our building and deployment process. At any time, the executable are ready (to test or to production) with workable condition. It includes,

1. Maintain a code repository
Common shared repository to maintain code. Actually its Version Control system.


2. Automate the build
Using available code in common repository, system will do building process to generate executable. This building process will be done automatically.


3. Make the build self-testing
While doing building process, system itself will check for errors and warnings in build process.


4. Everyone commits to the baseline every day
All available stakeholders will commit their part of code changes every day or as soon as possible after doing changes so that it will not affect the full application. Also if your changes are conflict with repository copy, then it wont allow you to commit unless you get latest, do changes and commit.


5. Every commit (to baseline) should be built
For each and every committing done by users, the build process will be triggered.


6. Keep the build fast
Building process will be fast enough as every day code changes are committed and no major changes will not be there. This will avoid unnecessary ambiguities in code.

7. Test in a clone of the production environment
As we have working software deliverable ready all the times, we can test using the clone of latest executable. This will ensure quality confidence on changes made in new build.


8. Everyone can see the results of the latest build
Everyone can know the status of latest build. If any errors or warnings while building, system will report the errors to all stake holders.


9. Automate Installation / Deployment
As we have latest build for each day, we can automate the deploying processes. This will ensure the latest application build is up for testing on each day.


Version Control:
VC is a system which provides a shared repository to your code and maintains the changes by keeping the different version of file.


CruiseControl, Hudson, teamcity, Bamboo, etc. are CI tools.
SVN, Visual SourceSafe, Git, etc are Version Control tools.
Maven, ant are build tools.


Hope this will you some ideas about CI and VC.

Monday, December 12, 2011

Use JQuery locators in Selenium

Hi all,
As we all know, Xpath locators are always slow we are going for CSS locators. To simplify and extensive use of CSS, JQuery locators will help as its using css concept.
I have found a useful link to achieve this. 
JQuery Locators In Selenium
Hope this will give you some ideas...

Selenium Locators - Hand Book

Hi all, 
Here I added a Selenium Locators Hand Book which I got it from internet. It will be useful for selenium testers.
It consists locators like xpath, CSS and selenium for all type of objects.


You can download here.

Automate testing of Flex / Adobe AIR application


Hi,
Automating special kind of UIs are always some complex and still more tools are keep on providing add-ons to support special UIs like Flex, SilverLight, etc. We have some good tools to automate flex 
applications easily. 
Lot of tools in market providing flex and silverlight support like market giants QTP, TestComplete, RFT etc.
Here are some other tools you can make,

Commercial Tools:
1. RIATest
Its a nice and simple tool which have good set of features and reporting. Its desktop application which can be used to automate adobe AIR, flex and windows based applications. 

2. RanoRex
RanoRex is a good tool but not got famous. Its Object identification is fully XPath like concept for both Web and Desktop apps called RanoreXPath. It have Object Spy, Object Repository, Recorder and PlayBack and good reporting like QTP.

OpenSource Tools:
1. FlexMonkey  
Its a open source adobe AIR application which provides record and playback support for flex, AIR applications. Simple tool which provides neat recording and playback. Can be used for unit testing of regression cases. Also provides reporting abilities.
Based on ActionScript and provides support many ways like
  • Desktop Adobe AIR application -- FlexMonkey
  • PlugIn for Selenium Tests - FlexMonkium
  • PlugIn for Android/iOS mobile testing - FoneMonkey
2. FunFX 
FunFx is also an open-source tool which provides record and playback of flex applications. It supports ruby language to code.

Sizzle - JQuery Based Selector Engine for Selenium


Hi all,
Here I want to speak about a well-designed jquery based selector engine which we can use to find web elements easily with manu available options.
Sizzle is custom designed selector engine. It provides many easy-of-use features to find complex web elements easily. 
You can find more options from HERE.
You can download sizzle from here. Download

Thursday, November 24, 2011

Top Security Testing Resources / Tools

A big community called "OWASP - Open Web Application Security Project" releases information about  software vulnerabilities for every year. Also you can learn lot of concepts here.
Here I have done listing of some security testing tools known,


Commercial Tools:
IBM Rational AppScan
HP QA Inspect
HP WebInspect
HP Fortify
Cenzic Hailstorm


OpenSource Tools:
WebScarab by OWASP community
BurpSuite
SkipFish - by Google

Sunday, November 20, 2011

Some good Resources / Blogs / Sites for Selenium Users

Here I have listed out some good blogs and sites by extensive selenium automation users. Hope these will help you a lot.

http://automationtricks.blogspot.com - by NirajKumar
http://www.theautomatedtester.co.uk/
http://testerinyou.blogspot.com  - by Naga/Mathu
http://seleniumready.blogspot.com - by Farheen Khan
http://seleniumdeal.blogspot.com/ - Amit Vibhuti
http://seleniumexamples.com/blog


Sauce Labs and BrowserMob are companies doing cloud and extensive selenium automation services, products, etc
http://saucelabs.com/blog
http://blog.browsermob.com
http://testingbot.com/


Cedric Beust - creator of the TestNG Java testing framework.
http://beust.com/weblog/


http://blog.reallysimplethoughts.com/ - by Samit Badle, Created many Selenium IDE Plug-Ins


Available Colud Testing:
1. SauceLabs
2. Soasta
3. BrowserMob
4. CloudTesting.com etc.

Selenium Testing Products:
1. Twist by ThoughtWorks
2. TestMaker by PushToTest
3. Element34 company providing selenium testing services, etc.

Monday, November 14, 2011

Selenium - waitForCondition with JavaScript Expressions


Selenium provides select method to select an item/option from drop-down lists and comboboxes. But this will work for simple listboxes only. For complex comboboxes like textbox with image, clicking the image will open drop-down list will not support normal methods. Here I am listing out different ways to handle select boxes. Thanks to bloggers as I read these from one and more blogs.


Exmaples:
Consider the following example where there are two drop-downs, one for the states and the other for counties.
The county drop-down is populated based on the state selection.
You can see in the site above, when the state is selected, a spinner shows up for a few seconds before the county drop-down is populated. 
Here we are using waitForCondition as it allows to mention explicitly TIMEOUT whereas selenium provided waitFor allows only default TIMEOUT value.

1. Dependent drop-down Lists using waitForCondition
Using waitForCondition and some JavaScript, we wait until display style attribute changes to ‘none’ in the snippet below.
  1. selenium.open("myURL");
  2. selenium.selectFrame("mainFrame");
  3. selenium.select("state""label=California");
  4. selenium.waitForCondition("var value = selenium.browserbot.findElementOrNull('loading_county_drop_down'); value.style.display == 'none'","10000");
  5. selenium.select("county""label=Amador County");

2. Using waitForCondition for multiple Conditions
  1. selenium.waitForCondition("var value = selenium.browserbot.findElementOrNull('loading_county_drop_down'); value.style.display == 'none' || selenium.browserbot.getUserWindow().document.form.county.options[0].text == 'Select a county of California';""10000");

3. Using waitForNotVisible and/or waitForSelectOptions
  1. selenium.waitForNotVisible("loading_county_drop_down");
  2. selenium.waitForSelectOptions("county","regexpi:Amador County");

4. Progress Messages:
You may have seen many AJAX intensive sites displaying a ‘Loading..’ or ‘Saving..’ or ‘Processing…’ message when a button or a link is clicked. In such cases you may find this to be helpful to wait for the status text to change or disappear.
Assuming that a ‘Saving’ message is displayed within a div tag when a fictional ‘Save’ button is clicked in the snippet below:
  1. selenium.waitForCondition("var value = selenium.getText(\"//div[@class='save-text']\");value != \"Saving\"""20000"); 
In general, .Net sites that use the web form controls, panel controls etc, trigger an asynchronous postback everytime a form control is filled or a .Net tab or panel control is clicked etc. In such cases, I’ve found the following to be very helpful in waiting for the postback to complete.
  1. selenium.waitForCondition("selenium.browserbot.getUserWindow().Sys.WebForms.PageRequestManager.getInstance().get_isInAsyncPostBack() == false;","10000"); 
Now for the killer part, for sites that use jQuery, if all you need is to confirm there aren’t any active asynchronous requests, then the following does the trick:
  1. selenium.waitForCondition("selenium.browserbot.getUserWindow().$.active == 0""10000");
As you can see, there are several possible variations to a single command. The possibilities are endless with Selenium.

Selenium - Drag and Drop Operation


The inbuilt dragAndDrop function provided by selenium RC classes will do the expected operation well easily. Some times its difficult to do drag and drop operations like drop on particular element, etc. Here is the approach.


1. Drag an element to drop on to another element:
  1. driver.get("myURL");
  2. var from = driver.findElement(By.xpath("fromElement"));
  3. var to = driver.findElement(By.xpath("toElement"));
  4. new Actions(driver).dragAndDrop(from, to).build().perform();

2. Drag an element to an offset:
  1. driver.get("myURL");
  2. var dragElement = browser.findElement(By.id("ElementToDrag"));
  3. new Actions(driver).dragAndDropBy(dragElement , 20010).build().perform();


Selenium - Handle JavaScript Alert and Confirmation boxes


Confirmation boxes  and Alerts are handled in same way in selenium.

  1. var alert = driver.switchTo().alert();
  2. alert.dismiss();  //Click Cancel or Close window operation
  3. alert.accept();   //Click ok

Handle Confirmation boxes via JavaScript,
driver.executeScript("window.confirm = function(msg){return true;};");


Selenium - Handle Iframes/Frames easily

Hi all,
Here I am going to list out ways to handle iFrames parts in selenium automation as I read from some sites.
Example-1:


  1. //Gmail Body is an iframe. Here we are writing content to body of new mail in selenium
  2. var bodytext="Sample Body Text for Testing";  
  3. var iframe_locator = "css=table:contains('Subject:') +*  iframe\";
  4. var iframe_body = selenium.browserbot.findElement(iframe_locator).contentWindow.document.body;
  5. if (browserVersion.isChrome) {    
  6.   iframe_body.textContent=bodytext;
  7. }  else if(browserVersion.isIE) {
  8.   iframe_body.innerText=bodytext;
  9. }

Example-2:

  1. //Switch to the frame - use index/name
  2. driver.switchTo().frame("frameName"); 
  3. //Also you can use like 
    SwitchTo.Frame(relative=up)
    SwitchTo.Frame(relative=top)

    // Do your operations in frame 
  4. //Switch back to the parent window
  5. driver.switchTo().defaultContent();





Sunday, November 13, 2011

Selenium Rare Tips - Part II

1. Get Browser Name, Version and Environment Details
Java Script Expressions which you can use by Selenium.getEval to get the values.


  1. navigator.appCodeName   //For Browser Name
  2. navigator.appVersion    //For Browser Version
  3. navigator.userAgent     //For both details
  4. navigator.appName       //For Browser Name
  5. navigator.cookieEnabled //Cookie enabled or not
  6. navigator.platform      //OS


2. Get Current URL
selenium.getLocation()

3. Scroll Bar Position

  1. Actual Width/Height of element:(Excluding ScrollBar)
  2. selenium.browserbot.getCurrentWindow().document.getElementByid('css#id').clientWidth
  3. selenium.browserbot.getCurrentWindow().document.getElementByid('css#id').clientHeight
  4. Max Scroll Position:
  5. scrollWidth - clientWidth    //Max Horizontal Scroll Position
  6. scrollHeight - clientHeight  //Max Vertical Scroll Position
  7. Current Scroll Position:
  8. scrollLeft
  9. scrollTop

If you are using Selenium 1.0, use this.browserbot
If you are using Selenium 2.0, use selenium.browserbot

4. JavaScript Expression execution in Selenium 2.0

  1. JavascriptExecutor js = (JavascriptExecutor)driver;
  2. String title = (String) js.executeScript("return document.title");
  3. System.out.println(title);
  4. String script = "var ele = document.getElementsByTagName(\"a\");" +
  5.                 "return ele[0].getAttribute(\"title\");";
  6. String titleName = (String) js.executeScript(script);