Monday, October 14, 2013

Mobile Testing Process

Mobile testing is conducted on both hardware and software to assure the quality of mobiles and PDAs. Mobile testing is performed using various activities such as monitoring and troubleshooting mobile application and other services on various handsets.
Android applications are in a great use in this developing technological world. But development of these android applications is a complicated business. Hardware vendor interface, multiple operating system and network capabilities are the major fields that require testing.

Apart from mobile application testing there are several other fields of testing that are very important to be performed before the mobile device is sent in the market. These can be listed as under:



  • Mobile software testing
  • Network testing
  • Signal receiving testing
  • Battery testing
  • Hardware testing
  • Games testing
  • And many more…

Mobile device testing checks a handset for it’s functionality and usability. Once a mobile software is developed, it is very important to make sure that it works as per the requirement and to check it, functional testing is performed.

Laboratory testing is also done to detect if there are any glitches when the mobile application uses it for data connection. It is usually carried out by network carriers by simulating the complete wireless network.

A very common problem with all the mobile users is bad network coverage. Low battery and low memory are the others that frustrate us, if occur. This can happen either from applicant’s server side or even from client’s side. So, to check both of these, Performance testing is performed.
Functioning and performance of mobile devices is also checked and improved by Mobile Leakage testing. Problem of slowdown of the system is improved by this mobile testing.

Interruptions can be faced anywhere and anytime and so is the case with mobile applications. Incoming and outgoing calls, SMS, MMS and notifications, battery removal, media player ON/OFF are some of the interruptions faced by almost all mobile applications. To eliminate these, a mobile testing is performed, which is known as Interrupt testing.
Other than these, Usability testing is also performed for verification of mobile applications and response from users.

There are many applications that come pre-installed in the mobile device but some of applications need to get installed from the store. In order to make this installation from the store smooth and error free, Installation testing is done.
Last but not the least is the Certification testing which is done against the guidelines set by various mobile platforms and is important for every mobile.



Tuesday, September 10, 2013

SELENIUM RC

What is Selenium RC?

Selenium RC (Remote Control) is an automation test tool that allows to create automation scripts for web based testing in any programming language such as JAVA, C#, PHP, Ruby, Python etc.
Selenium RC injects javascript to execute the test and is really ease to work with all browsers and platforms and also good supported for ajax applications as well.

Selenium RC have two parts:

  • Selenium server - Launches the browser and execute the test cases.
  • Selenium remote control - Provides an application programming interface with lots of libraries to support different programming languages

Architecture:

With different programming language and object oriented support gives you the ability to create more complex test cases that are not possible through Selenium IDE. You can executes these test cases as many time as required by using frameworks available in Java i.e. TestNG or JUnit. Also helpful while handling expected exceptions.

How to configure Selenium RC?

Pre Requisite:

Start Selenium RC standalone server:
Open command prompt and go to the directory where the Selenium RC jar file was kept and then write:

java -jar selenium-server-standalone-2.20.0 


Create a new class file and copy paste the recorded script code. Now run it as a Java application.

Basic Selenium RC methods:
  • selenium.start() - Takes you to the location where selenium server is and runs the server.
  • selenium.open() - Takes you to the provied URL/Website address.
  • selenium.getTitle() - Get the title of the current browser window.
  • selenium.windowFocus() - Get the focus on the current window.
  • selenium.windowMaximize() - Maximizes the current window.
  • selenium.close() - Close the current browser window.



Method Detail:

start

public void start()
Description copied from interface:
Launches the browser with a new Selenium session

stop

public void stop()
Description copied from interface:
Ends the test session, killing the browser

click

public void click(java.lang.String locator)
Description copied from interface:
Clicks on a link, button, checkbox or radio button. If the click action causes a new page to load (like a link usually does), call waitForPageToLoad.

doubleClick

public void doubleClick(java.lang.String locator)
Description copied from interface:
Double clicks on a link, button, checkbox or radio button. If the double click action causes a new page to load (like a link usually does), call waitForPageToLoad.

clickAt

public void clickAt(java.lang.String locator,
                    java.lang.String coordString)
Description copied from interface:
Clicks on a link, button, checkbox or radio button. If the click action causes a new page to load (like a link usually does), call waitForPageToLoad.


doubleClickAt

public void doubleClickAt(java.lang.String locator,
                          java.lang.String coordString)
Description copied from interface:
Doubleclicks on a link, button, checkbox or radio button. If the action causes a new page to load (like a link usually does), call waitForPageToLoad.


fireEvent

public void fireEvent(java.lang.String locator,
                      java.lang.String eventName)
Description copied from interface:
Explicitly simulate an event, to trigger the corresponding "onevent" handler.

keyPress

public void keyPress(java.lang.String locator,
                     java.lang.String keySequence)
Description copied from interface: 
Simulates a user pressing and releasing a key.


shiftKeyDown

public void shiftKeyDown()
Description copied from interface:
Press the shift key and hold it down until doShiftUp() is called or a new page is loaded.


shiftKeyUp

public void shiftKeyUp()
Description copied from interface: Release the shift key.

metaKeyDown

public void metaKeyDown()
Description copied from interface: Selenium
Press the meta key and hold it down until doMetaUp() is called or a new page is loaded.





Friday, September 6, 2013

Selenium Q & A

Q :which component is NOT part of Selenium suite.

A: Selenium Web 

Q :which language is NOT supported by the Selenium RC.

A: ASP

Q : which name is NOT the type of the locaters.

A: Password

Q : Is Web Driver a component of the Selenium?

A: Yes 

Q : Selenium IDE stands for

A: Selenium Integrated Development Environment
Q : Select the Browser which is supported by Selenium IDE
A: Mozilla Firefox 
Q : which operating system is NOT supported by Selenium IDE.
A: Unix
Q : The Web driver is used.

A : To execute tests on the HtmlUnit browser.  
Q : The Selenium IDE is used

A : To test a web application against Firefox only.
Q : The Selenium RC is used

A : To run your test against different browsers (except HtmlUnit) on different operating systems. 
Q : which command is NOT a type of assertion in Selenium IDE.
A: Wait command.

Q : which method selects the option at the given index.

A :selectByIndex() 
Q :Can Google chrome be supported by Selenium IDE?

A: No.

Q : Can Unix operating system be supported by Selenium IDE?

A :
No 
Q : Which command can be used to enter values onto text boxes?
A : sendKeys() 
Q :which language is supported by The Selenium Web Driver.
A : Perl
Q : Which Selenium component supports All Operating System?
A : Selenium WebDriver 
Q : Which command in Selenium IDE used to open a page using the URL.
A : Open 
Q : In case of Selenium IDE, the Source view shows your script in

A :
HTML format. 
Q : which command is used to print a string value or a variable in Selenium IDE.

A: The 'echo' command.

Q : Which component of Selenium can create customized test results.

A : Web driver 
Q : which command is used to compare the contents of a table with expected values.
A : verifyTable 

Tuesday, August 13, 2013

Handling Keyboard & Mouse Events in Selenium

Handling special keyboard and mouse events : It contains the Actions and the Action classes that are needed when executing these events.

ClickAndHold() : Clicks (without releasing) at the current mouse location.ContextClick() : Performs a context-click at the current mouse location.
DoubleClick() : Performs a double-click at the current mouse location.
dragAndDrop(source, target) : Performs click-and-hold at the location of the source element, moves by a given offset, then releases the mouse.
keyDown(modifier_key) : Performs a modifier key press. Does not release the modifier key - subsequent interactions may assume it's kept pressed.
Parameters:
modifier_key – any of the modifier keys (Keys.ALT, Keys.SHIFT, or Keys.CONTROL)

keyUp(modifier _key) : Performs a key release.
Parameters:
modifier_key – any of the modifier keys (Keys.ALT, Keys.SHIFT, or Keys.CONTROL)

moveByOffset(x-offset, y-offset) : Moves the mouse from its current position (or 0,0) by the given offset.
Parameters:
x-offset- horizontal offset. A negative value means moving the mouse left.
y-offset- vertical offset. A negative value means moving the mouse up.

moveToElement(toElement) : Moves the mouse to the middle of the element. Parameters:
toElement- element to move to.

Release() : Releases the depressed left mouse button at the current mouse locationsendKeys(onElement, charsequence) : Sends a series of keystrokes onto the element. Parameters:
onElement - element that will receive the keystrokes, usually a text field
charsequence – any string value representing the sequence of keystrokes to be sent.

Monday, August 12, 2013

Introduction to Selenium Grid

What is Selenium Grid?

 Selenium Grid is a part of the Selenium Suite that specializes on running multiple tests across different browsers, operating systems, and machines in parallel.

Selenium Grid has 2 versions –
Grid 1 and Grid 2.

Use of Selenium Grid


Run your tests on different browsers, operating systems, and machines all at the same time. This will ensure that the application you are testing is fully compatible with a wide range of browser and OS combinations.
    Save time in execution of your test suites. If you set up Selenium Grid to run, say, 4 tests at a time, then you would be able to finish the whole suite around 4 times faster.

Difference between Grid 1.0 and Grid 2.0


Grid 1.0

1. Selenium Grid 1 has its own remote control that is different from the Selenium RC server.
2. You need to install and configure Apache Ant first before you can use Grid 1.
3. Can only support Selenium RC commands/scripts.
4. You can only automate one browser per remote control.


Grid 2.0

1. Selenium Grid 2 is now bundled with the Selenium Server jar file
2. You do not need to install Apache Ant in Grid 2.
3. Can support both Selenium RC and WebDriver scripts.
4. One remote control can automate up to 5 browsers.


 Hub and Node


The hub is the central point where you load your tests into.

  • Only one hub should be in a grid.
  • The hub is launched only on a single machine.
    The Nodes
  • Nodes are the Selenium instances that will execute the tests that you loaded on the hub.
  • There can be one or more nodes in a grid.
  • Nodes can be launched on multiple machines with different platforms and browsers.


Selenium Grid is used to run multiple tests simultaneously in different browsers and platforms.
  • Grid uses the hub-node concept.
  • The hub is the central point wherein you load your tests.
  • Nodes are the Selenium instances that will execute the tests that you loaded on the hub.
  • To install Selenium Grid, you only need to download the Selenium Server jar file – the same file used in running Selenium RC tests.
  • There are 2 ways to verify if the hub is running: one was through the command prompt, and the other was through a browser
  • To run test scripts on the Grid, you should use the DesiredCapabilities and the RemoteWebDriver objects.
  • DesiredCapabilites is used to set the type of browser and OS that we will automate
  • RemoteWebDriver is used to set which node (or machine) that our test will run against.

Friday, July 19, 2013

Introduction to Web Driver

WebDriver is a web automation framework that allows you to execute your tests against different browsers, not just Firefox (unlike Selenium IDE).
Web driver execute script > Mozilla Firefox, Internet explorer, Safari, Google Chrome, Opera browser.

WebDriver also use a programming language in creating your test scripts(which is not possible in Selenium IDE).
  • Use conditional operations like if-then-else or switch-case 
  • Use looping like do-while.
Following programming languages are supported by WebDriver
  • Java
  • .Net
  • PHP
  • Python
  • Perl
  • Ruby

WebDriver Vs Selenium RC


They both allow you to use a programming language in designing your test scripts. They both allow you to run your tests against different browsers.

It controls the browser from the OS level
All you need are your programming language’s IDE (which contains your Selenium commands) and a browser.

Selenium RC’s architecture is way more complicated.

The Selenium RC Server acts as a “middleman” between your Selenium commands and your browser.
  • When you begin testing, Selenium RC Server “injects” a Javascript program called Selenium Core into the browser.

  • Once injected, Selenium Core will start receiving instructions relayed by the RC Server from your test program.

  • When the instructions are received, Selenium Core will execute them as Javascript commands.
  • The browser will obey the instructions of Selenium Core, and will relay its response to the RC Server.

  • The RC Server will receive the response of the browser and then display the results to you.

  • RC Server will fetch the next instruction from your test script to repeat the whole cycle.

WebDriver is faster than Selenium RC

Selenium RC is slower  since it uses a Javascript program called Selenium Core. This Selenium Core is the one that directly controls the browser, not you.

Limitations of WebDriver


WebDriver Cannot Support New Browsers:


Remember that WebDriver operates on the OS level. Also remember that different browsers communicate with the OS in different ways. If a new browser comes out, it may have a different process of communicating with the OS as compared to other browsers. So, you have to give the WebDriver team quite some time to figure that new process out before they can implement it on the next WebDriver release.

Selenium RC automatically generates an HTML file of test results. The format of the report was pre-set by RC itself. Take a look at an example of this report below.

WebDriver has no built-in command that automatically generates a Test Results File. You would have to rely on your IDE’s output window, or design the report yourself using the capabilities of your programming language and store it as text, html, etc.

WebDriver is a tool for testing web applications across different browsers using different programming languages.
  • You are now able to make powerful tests because WebDriver allows you to use a programming language of your choice in designing your tests.
  • WebDriver is faster than Selenium RC because of its simpler architecture.
  • WebDriver directly talks to the browser while Selenium RC needs the help of the RC Server in order to do so.
  • WebDriver’s APIismore concise than Selenium RC’s.
  • WebDriver can support HtmlUnit while Selenium RC cannot.
  • The only drawbacks of WebDriver are:
  • It cannot readily support new browsers, but Selenium RC can.
  • It does not have a built-in command for automatic generation of test results.

Friday, July 5, 2013

Automation Testing..

Test Cases to Automate
  • Test cases to be automated can be selected using the following criterion to increase the automation ROI
    • High Risk - Business Critical test cases
    • Test cases that are executed repeatedly
    • Test Cases that are very tedious or difficult to perform manually
    • Test Cases which are time consuming
    The following category of test cases are not suitable for automation:
    • Test Cases that are newly designed and not executed manually  atleast once
    • Test Cases for which the requirements are changing frequently
    • Test cases which are executed on ad-hoc basis.
    About Automated Testing
    Manual testing is performed by a human sitting in front of a computer carefully executing the test steps. Automation Testing means using an automation tool to execute your test case suite.   The automation software can also enter test data into the System Under Test ,  compare  expected and actual  results and generate detailed test  reports.
    Test Automation demands considerable investments of money and resources. Successive development cycles will require execution of same test suite repeatedly.
    Automated testing is important due to following reasons: 

    • Manual Testing of all work flows, all fields , all negatice scenarios is time taking and costly.
    • Automation does not require Human intervention. You can run automated test unattended (overnight)
    • Automation increases  speed of test execution
    • Automation helps increase  Test Coverage

    The following category of test cases are not suitable for automation:
    • Test Cases that are newly designed and not executed manually  atleast once
    • Test Cases for which the requirements are changing frequently
    • Test cases which are executed on ad-hoc basis

    • Define the scope of Automation


  • Scope of automation is the area of your Application Under Test which will be automated. Following points help determine scope:
    • Feature that are important for the business
    • Scenarios which have large amount of data
    • Common functionalities across applications
    • Technical feasibility
    • Extent to which business components are reused
    • Complexity of test cases
    • Ability to use the same test cases for cross browser testing

  • Test Execution process

  • Automation Scripts are executed during this phase. The scripts need input test data before there are set to run. Once executed they provide detailed test reports.  
    Execution can be performed using the automation tool directly or through the Test Management tool which will invoke the automation tool.


    Example: Quality center is the Test Management tool which in turn it will invoke QTP for execution of automation scripts. Scripts can be executed in a single machine or a group of  machines. The execution can be done during night , to save time.

    How to Choose an Automation Tool? 

    • Selecting the right tool can be a tricky task. Following criterion will help you select the best tool for your requirement-

      • Environment Support
      • Ease of use
      • Testing of Database
      • Object identification
      • Image Testing
      • Error Recovery Testing
      • Scripting Language Used
      • Support for various types of test – including functional, test management, mobile, etc…
      • Support for multiple testing frameworks
      • Easy to debug the automation software scripts
      • Ability to recognize objects in any environment
      • Extensive test reports and results
      • Minimize training cost of selected tools 

      Benefits of automated testing

       Following are benefits of automated testing:

        • 70% faster than the manual testing
        • Wider test coverage of application features
        • Reliable in results
        • Ensure Consistency
        • Saves Time and Cost
        • Improves accuracy
        • Human Intervention is not required while execution
        • Increases Efficiency
        • Better speed in executing tests
        • Re-usable test scripts
        • Test Frequently and thoroughly
        • More  cycle of execution can be achieved through automation 
        • Early time to market