Showing posts with label Automation Testing Framework. Show all posts
Showing posts with label Automation Testing Framework. Show all posts

Sunday, 21 April 2013

How to Develop Automation Framework

 Hi All,

A very nice video explaining the right way to develop automation framework.


Thanks
Dibyaranjan

Saturday, 11 August 2012

Why (Why Not) Automation Testing


Automation testing is validating the application using a BOT/Program. That is, automating the process/steps, which a manual tester used to perform.

Automated testing is important due to following reasons:
   1) Manual Testing is time and cost consuming
   2) It is difficult to test for multi lingual languages  manually
   3) Automation does not require Human intervention. You can run automated test unattended (overnight)
   4) Automation increases  speed of test execution
   5) Automation helps in increasing  Test Coverage, more time for manual tester to do free testing.
   6) Manual Testing can become boring and hence error prone

Which Test Cases to Automate?
   1) High Risk - Business Critical test cases needs to executed before reaching Customer.
   2) Test cases that are executed repeatedly
   3) Test Cases that are very tedious or difficult to perform manually
   4) Test Cases which are time consuming

Which Test Cases not to Automate?
   1) Test Cases that are newly designed and not executed manually  atleast once
   2) Test Cases for which the requirements are changing frequently
   3) Test cases which are executed on ad-hoc bases.

Automation Testing Process

Below screenshot shows the flow of automation testing process.
Tool Selection-: Where you select the best suited tool for your product, Things you may need to consider here are, is my product is desktop based or web based. Is my testing required related to back end or front end and UI based testing. Can you afford a licensed tool or do you need an open source tool?

Once you decide/select the tool to use for automation testing, next thing up is defining Scope of the automation testing.

Scope Define-: Never jump to write test scripts as soon as you get the tool. Define/Select what needs to be tested in other words, select the test cases which you want to automate. May be for the starter, select cases for POC, major test cases in your application.

Script Development -: Then design your framework, and continue your script development. We will see about designing test framework in the next post.

Maintenance-: Once you are done with script development, then continue the script run and maintain your scripts for any change in the application.

Please feel free to drop a comment if you have any suggestion/issue/comment related to the above post.

Thanks!!!

Saturday, 28 July 2012

Wrapping Up the Find Element Method

For a quite some time,  I thought of writing about actual way of using automation tool api in the test code, so that it can become more readable, maintainable, easy to debug. I will be writing with tool in mind Selenium/WebDriver (mostly famous open source tool in recent times.)

So while designing a automation framework, we need to design in such a way that will minimize the change. Lets talk about Selenium/WebDriver find element. WebDriver has 2 methods to find element/s.
1)findElement
2)findElements

Ok, take closer look at findElment method, how it works? (Forgive me, i work only on Java bindings:))

WebElement myElem=driver.findElement(By.{manythings});

{manythings}=id,xpath,css,name,class,linktext

If you want to write a script to automate search in google page, then may be you need to use find element 2 times.
1)Open URL
2)find search text box
3)enter value to search field
4)find search button to click
5)Click on it.


For every find element, you want to implement the wait mechanism also. So if you keep on adding find element in your test code, it will be difficult for you to maintain it.


Now lets consider, Selenium guys think differently and then change the findElement() method name to findDOMElement(), Worst case:) they change the signature of the method also. What will you do? change in every place of your code, "IT WILL BE A NIGHTMARE" for you.


Lets see how we can handle this.
Create our own findElement method which takes parameter as, Parent Element, Locator Type, Locator value/expression.







Now in the above code, you can see another method PingDOMToFindElement is also called, which is wrapping the code to wait for some time for the element to appear in the DOM.


Lets see PingDOMToFindElement method also.




So here is method which actually does the work for you. This method implements web driver's explicit wait and have the web driver find element method. Locator type is type of locator you want to use like css, id, name or xpath. Locator value will be the  expression for the corresponding locator type. if you want to search element within a parent element or driver instance that will be decided by the first parameter, if it is null search within driver context else using the parent element specified.

So does it look cool now? easy to maintain? easy to debug? Do you think, we can make it much better? Please feel free to leave a suggestion/comment before leaving. 


Thanks!!

Related Posts

Related Posts...