Archive for the ‘Automation’ Category

  • Verified that the link takes you to the page it said it would.
  • Ensure to have no orphan pages (a page that has no links, on buttons, tabs
  • etc to it)
  • Ensure that all referenced links or email addresses must be hyperlinked.
  • Check all mailto links and whether it reaches properly
  • Ensure that all the data’s inside combo/list box must be arranged in chronological order.
  • Check the maximum field lengths to ensure that there should not any truncated characters.
  • Assure that leap years are validated correctly & do not cause errors/miscalculations.
  • Include value zero in all calculations.
  • Assure that upper and lower values in ranges are handled correctly. (Using BVA)
  • Each field should get highlighted when the cursor is in that field.
  • Default values on page load/reload (Also terms and conditions should be disabled)
  • Ensure that division by zero does not occur.
  • Navigation should work correctly with the input methods offered by the device.
  • An application for a touch device should use touch interaction to navigate all functions/screens of the application, e.g. tapping buttons, navigating lists etc.
  • Ensure that all interactive elements such as buttons must respond to touch interaction on first use. It must not be difficult to touch an interactive element, such as a button, link, image, etc.
  • Checks weather all requirements and checkpoints are covered.
  • Give multiple inputs (Text inputs) at a time and the app should work according to that.
  • Check the app weather it syncs with native functionalities.
  • Whether checks for optional and mandatory fields carried out like a mandatory field should not be left blank and an optional should allow the user to skip the field.
  • Closing of the application should result in “Are you sure?” message.(Depends upon app)
  • Verify if the application continuous from the same place after minimizing and restarting it.
  • Ensure that home page of an app should be loaded quickly within 8 seconds.
  • If the device is tilted from portrait mode to landscape mode and vice versa, the app should self adjust as per the device resolution (condition: if the application supports both landscape and portrait modes).
  • If the device is tilted from portrait mode to landscape mode, the screen should display an error message asking the user to switch the device back to landscape mode or the screen resolution should not change (condition: if the application supports only portrait mode)
  • If the device is tilted from landscape mode to portrait mode, the screen should display an error message asking the user to switch the device back to portrait mode or the screen resolution should not change (condition: if the application supports only landscape mode)
  • Verify the functionality for the Background music [If any]
    • When music running in the background of the App/game
    • App goes into idle mode
    • When app comes from the idle mode

Expected behavior: Background music should be running.

  • When the Application uses network capabilities, it must be able to handle network delays and any loss of connection.
    Launch the Application.
    Start the network access from the Application.
    Put the phone in a place where there connection will be lost.
    Observe the result.
    Expected behavior: The Application will work until time out and then give an error message to the user indicating there was an error with the connection.
  • When the Application uses network capabilities, it must be able to handle the device being in Airplane mode.
    Set the device to Airplane mode
    Start the Application.
    Observe the result.
    Expected behavior: The Application will give a meaningful error message to indicate that the device is in Airplane mode and the application cannot run successfully.
  • Verify for the Network Reachebility.
    Expected behavior: Popup should be detect when the network is unavailable and provide a (pop-up) message informing the user.
  • Verify the Materials or Advertisements.
    Expected behavior: Marketing materials or advertisements should not be there at the app (app will be rejected)
Advertisements

How to extract no. of links and text of  links present on a page in Selenium WebDriver:

We all know that tag name for every link starts with letter “a”. “a” refers to the anchor tag. The tag name which starts with letter “a” should be a link.

Because all links has tag name “a” so we can identify links with tagName method of By class i.e.

driver.findElements(By.tagName(“a”));

To find the total no of links on a page:

Suppose you want to find total no. of links on google page for this you can use

driver.get(“http://www.google.com”);

List<WebElement> alllinkspresent=driver.findElements(By.tagName(“a”));

System.out.println(“no. of links on google page are :” +alllinkspresent.size());

Where size() method returns the total no of links on Google page.

To find or print the name of links i.e. text of links:

Suppose you want to print text of all links present on Google page for this you can use

for(int i=0; i< alllinkspresent.size(); i++)

{

System.out.println(alllinkspresent.get(i).getText());

}

To extract the links of a particular section:

Suppose you want to extract the links of languages offered by Google section for this you can use

WebElement LangSection=driver.findElement(By.xpath (“//*[@id=’addlang’]”));

List<WebElement> lang=LangSection.findElements(By.tagName(“a”));

for(int i=0; i< lang.size(); i++)

{

System.out.println(lang.get(i).getText());

}

Where LangSection is one WebElement and we have to find the all the links present in this section. For understanding of this section of code please refer following screen shot

When you run the above code you will get text of all links present in this section. Refer following screen shot

Different methods to locate UI Elements (WebElements) or Object Recognize Methods:

There are different methods to locate UI Elements (WebElements) or to recognize objects which are as follows:
· By ID
· By Tag Name
· By Class Name
· By Link Text
· By Name
· By Partial Link Text
· By XPATH

By ID:

This method is most efficient and mostly used to locate the elements. Every element has its unique id.

Let’s take the example for Google, suppose we have to find/locate the search box of goggle. Use firebug option of Mozilla Firefox with which you can easily locate the element in HTML format. Please refer following screenshot:

<td id=”gs_tti0″ class=”gsib_a”>

Id of Search box of goggle is gs_tti0.

Now Example for how to find an element via using ID:

WebElement element = driver.findElement(By.id(“gs_tti0”));

 By Tag Name:

To find tag name of a use fire bug.

Let’s take the example for Google, suppose we have to find/locate the “Google Search” button of goggle via tag name. Use firebug option of Mozilla Firefox with which you can easily locate the element in HTML format. Please refer following screenshot:

<input type=”submit” onclick=”this.checked=1″ name=”btnK” value=”Google Search”/>

Tag Name of Google Search” button of goggle is input here.

Now Example for how to find an element via using TagName:

WebElement element = driver.findElement(By.tagName("input"));

By Class Name:

There may be many elements that are associated with same class name so finding multiple elements becomes the more practical option over finding the first element.

Example of how to find an element that looks like this:

<div class=”tsf-p” style=”position:relative”>

Here tsf-p is classname.

List<WebElement> element = driver.findElements(By.className("tsf-p "))
Remember that use findElements method instead of findElement to find multiple elements.

 By Link Text:

By using By Link Text method of class “By “you can find link element with matching visible text.

Let’s take the example for Google, suppose you want to find/locate the “Advertising Programs” link of goggle via Link Text.

Now Example for how to find an element i.e. link via using linkText:

WebElement element = driver.findElement(By.linkText("Advertising Programs"));

By Name:

By using By Name method of class “By “you can find link element via name attribute of element.

Example of how to find an element that looks like this:

<input type=”submit” onclick=”this.checked=1″ name=”btnK” value=”Google Search”>

Here” btnK” is name.

List<WebElement> element = driver.findElements(By.name("btnK "))

By Partial Link Text:

By using “BypartialLinkText” method of class “By “you can find link element with Partial matching visible text.

Let’s take the example for Google, suppose you want to find/locate the “Advertising Programs” link of goggle via BypartialLinkText. For this you can use:

WebElement element = driver.findElement(By. partialLinkText ("Advertising"));

 By XPATH:

Xpath is a locator, it is an unique address which identifies each and every element.WebDriver uses a browser’s native XPath capabilities wherever possible. To find xpath of an element use firebug and fire path adons on Mozilla Firefox.

Let’s take the example for Google, suppose we have to find/locate the search box of goggle via using xpath. Use firebug option of Mozilla Firefox with which you can easily locate the element in HTML format and copy the xpath from xpath bar of firepath tab.Please refer following screenshot:

Now Example for how to find an element via using xpath:

WebElement element = driver.findElement(By.xpath("//*[@id='gs_tti0']"));
 Note: Don’t copy the dot from xpath bar.

 

Eclipse (software)

Download and Configuring the Selenium Webdriver in Eclipse:

Pre-requisites:

  • JDK
  • Eclipse setup
  • Selenium

Steps to Download and Configuring the Selenium Webdriver in Eclipse:

1. Go to http://seleniumhq.org/download/

2. Click on Download link which is associated with java release. Download the jar files. Refer following screenshot.

3. When you download it you will get a folder. In this folder you have two jar files related to selenium and a lib folder in which you have another jar files. Refer following screenshot.

4. Now Create a New project in Eclipse for this you have to follow the following steps:

  • Go to Eclipse –> Click File –> New –> Project
  • In Select Wizard –> Click Java –> “Java Project” (Refer following screenshot.)
  • Give the project name
  • Click Finish – Click Yes

5. Now add all jars which you have downloaded earlier. Go to properties by right clicking on project.

  • Click “Java Build Path”
  • Click Libraries tab
  • Click “Add External JARs” button
  • Select both selenium jars and all other jars from lib folder of downloaded folder.

If you like this post ,Don’t forget to write comments……………………

Selenium logo

Selenium2/Selenium Webdriver:

Selenium2=Selenium1+WebDriver

Webdriver is a tool for automating testing web applications. Webdriver makes direct calls to the browser using each browser’s native support for automation. Selenium Webdriver does not depends upon the server. We can directly run the programs/scripts in the main method. Selenium Webdriver is very simple, easy to use and to the point.

Features of Selenium Webdriver:

  • Selenium Webdriver supports various languages for example java, Python, C#, Ruby, Perl, Php, Java script.
  • No need to start selenium server.
  • Selenium Webdriver Supports iPhone and Android testing.
  • You can find coordinates of any object using Webdriver.
  • You can easily simulate clicking on front and back button of browser.
  • Keyword driven framework is very easy to build in webdriver.
  • Webdriver uses native automation and does not have the sandbox constraints of Selenium-RC. It’s a little faster and does not require a server.

 

If you like this post ,Don’t forget to write comments…………………

Selenium logo

Selenium 2 Introduction:

Selenium 2:

Selenium is a Web testing tool. Selenium is a robust set of tools that is used to record and run web applications. There are three components of Selenium. i.e. Selenium is composed of three major tools which has their own specific roles. Selenium is free and open source.

Selenium 2 provides drivers for:

  • Mozilla Firefox
  • Google Chrome
  • Microsoft Internet Explorer
  • Opera
  • Apple iPhone
  • Android browsers

Selenium-IDE:

Selenium-IDE is the Integrated Development Environment for building Selenium test cases. It operates as a Firefox add-on.

Advantages of Selenium-IDE:

It is very easy to use. It has record and play feature and we can also write our own extensions and implement loops, if statements, use arrays, parameterize test cases. Selenium-IDE is very user friendly.

Limitation of Selenium-IDE:

It gets installed as an add-on on Mozilla and works only on Mozilla. IDE cannot work on browsers other than Mozilla. That’s why RC or webdriver is used.

Selenium-RC (Remote Control):

Selenium Remote Control (RC) is a test tool that allows you to write automated web application UI tests in any programming language.

Advantages of Selenium-RC:

Selenium Remote Control is great for testing complex AJAX-based web applications. Selenium Remote Control can be used for any java script enabled browser.

Limitation of Selenium-RC:

In RC we have to start the server again and again i.e. RC completely depends upon server. Switching between the multiple instances of the same browser is not possible. Switching between the multiple instances of the different browsers is not possible.

Selenium-Grid:

Selenium Grid is a server that allows tests to use web browser instances running on remote machines. With Selenium Grid, one server acts as the hub.