MSBLOGS: 2016

Pages

Wednesday, August 31, 2016

Python script for Creating a Triangle/Pyramid with alphabets or printing the output in same line instead of new line..

Following script will create the triangle using alphabets. for using no comment the list a and change a[i]  to i. To print in reverse order interchange the for loop parameters.

Note: if you dont specify the , in the print statement then it will print the values of row in next line instead of printing continuously in same row.




Script:


a = ['a','b','c','d','e','f', 'g','h','i']
  
for j in range(0,8,1):
    print'\n'
    for i in range(8,0,-1):
        if i>j:
            print a[j],



Output of the program will be :


a a a a a a a a

b b b b b b b

c c c c c c

d d d d d

e e e e

f f f

g g 

Thursday, June 9, 2016

Python script for creating fibonacci series till n number and converting list to dict.

Fibonacci series is the series in which the each number is sum of its previous 2 numbers.

for eg: 0 , 1, 2, 3 (2+1), 5(3+2), 8(5+3)......


Example of conversion of list to Dict and finding the Fibonacci number up to n..

Example.py


def fib(n1, n2):
        fibnum = n1+n2
        return fibnum

class test(object):

    n1 = 0
    n2 = 1
    fiblist = []
    count = 10
   
    while(count>0):
        fibnum = fib(n1, n2)
        n1 = n2
        n2 = fibnum
        fiblist.append(fibnum)
        count = count-1
    print fiblist
    lilen = len(fiblist)
    print "length of list is",lilen
    i=0
    key_val = []
    print "The ninth element in the list is ",fiblist[9]


    # Now to convert this list in dict and adding the serial number as key and value from the Fibonacci list generated above/
    # first we will create another list from 0 to length of fiblist and then will combine both lists.

    
    while i <lilen:
        key_val = key_val+[i]
        i = i+1
        #print key_val
    print "The list items which will be used as key of dict items ",key_val

    listtodict = zip(key_val, fiblist)


    print "The dict created using fiblist and key_val is ", listtodict
   
    print "the value of 9th key in the dict is", listtodict[9]
_________________________________________________________



The output of the program is : 

(On running this script by typing filename.py on cmd prompt or eclipse (python interpreter)


[1, 2, 3, 5, 8, 13, 21, 34, 55, 89]
length of list is 10
The ninth element in the list is  89
The list items which will be used as key of dict items  [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
The dict created using fiblist and key_val is  [(0, 1), (1, 2), (2, 3), (3, 5), (4, 8), (5, 13), (6, 21), (7, 34), (8, 55), (9, 89)]
the value of 9th key in the dict is (9, 89)
 

________________________________________________________

Friday, May 27, 2016

Python program to calculate free candies with n number of candies where on every 3 candies 1 free candy is given.

Problem statement: A user is given n number of candies initially. There was a offer where on every 3 candy 1 more candy will be given for free. For eg: if he intially get 9 candy then he will get 3 free candy. and again on 3 free candy he will be given another free candy. so total candy will be 9+3+1. This look simple but when the initial candy count is bigger then it will need lot of calculation on finding free candies and again on free candies, user will receive more free candies and so on.
Using a simple program we will see how easily our script can solve this problem..
This also show the simplicity and flexiblity python provides for writing script (the conversion of int string etc). 
Here it goes: 

________________________________________________________________________________



"""
@Author: Madhusudan Vyas
@Objective: To find total and free chocalate with choc given initially by user and offere that on every 3 choc 1 chocalate is free.
"""
 ################################

class choc_count(object):   
    def find_free(self, n, newval):       
        while n/3>=1:
            free_a = int( n/3)
            newval = newval + int(free_a)
            n = free_a           
        return newval

initial_choc = raw_input("Enter the number of chocalate given initially ")
n=int(initial_choc)
i = 0
newval = 0
freech = choc_count()
free_ch = freech.find_free(n, newval)
total = n+ free_ch
print "new val of free choc : ", free_ch
print "new val of total choc : ", total


Here on running this script, this prog will ask for providing the number of candies given in the begining and then it will show how many free candies it will give and the total candies including initial and free candies.

XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX


Monday, April 25, 2016

WebDriver: Script for opening a link in new tab.

[java]

WebElement link = getMyDriver().findElement(By.xpath("//*[@id=’link’]"));
Actions newTab = new Actions(getMyDriver());
newTab.keyDown(Keys.SHIFT).click(link).keyUp(Keys.SHIFT).build().perform();
Thread.sleep(5000);

//handle windows change
String base = getMyDriver().getWindowHandle();
Set<String> set = getMyDriver().getWindowHandles();

set.remove(base);
assert set.size() == 1;
getMyDriver().switchTo().window((String) set.toArray()[0]);

//close the window
getMyDriver().close();
getMyDriver().switchTo().window(base);

// handle windows change and switch back to the main window
Thread.sleep(2500);
for (String winHandle : getMyDriver().getWindowHandles()) {
getMyDriver().switchTo().window(winHandle);
}



First create a WebElement to the link. We need an Action chain to press Shift key and then click on the link which will be opened in a new tab of the same widow.
Now we have to handle the window change.
1. First set the main window to a String with getWindowHandle().
2. To get all the windows handle as a list use  "getWindowsHandles()"
Now we remove the base window from the list and assert that the list size is 1.
After this we need to switch to the new window with the WebDriver:
getMyDriver().switchTo().window((String) set.toArray()[0]);

To close the window and switch back to the main window, use the following steps:
getMyDriver().close();
getMyDriver().switchTo().window(base);

Just for sure it was switched to the main window use the following window handles:
for (String winHandle : getMyDriver().getWindowHandles()) {
getMyDriver().switchTo().window(winHandle);
}

Steps to open a link in a new tab and switch to it:

WebElement link = getMyDriver().findElement(By.xpath("//*[@id=’link’]"));
Actions newTab = new Actions(getMyDriver());
newTab.keyDown(Keys.CONTROL).keyDown(Keys.SHIFT).click(link).keyUp(Keys.CONTROL).keyUp(Keys.SHIFT).build().perform();
Thread.sleep(5000);

//handle windows change
String base = getMyDriver().getWindowHandle();
Set<String> set = getMyDriver().getWindowHandles();

set.remove(base);
assert set.size() == 1;
getMyDriver().switchTo().window((String) set.toArray()[0]);

//close the window and sitch back to the base tab
getMyDriver().close();
getMyDriver().switchTo().window(base);


If we want to open the link in a new tab than we need to use the following action chain:
newTab.keyDown(Keys.CONTROL).keyDown(Keys.SHIFT) .click(link).keyUp(Keys.CONTROL).keyUp(Keys.SHIFT).build().perform();

It press CTRL+SHIFT keys then click to the link.
The other steps are similar with the steps we used in “switch-to-new-window” code above.

Monday, April 18, 2016

QA Automation: What is Data Driven Framework in Automation?

Data Driven Framework:

In this Framework , while Test case logic resides in Test Scripts, the Test Data is separated and kept outside the Test Scripts.Test Data is read from the external files (Excel Files, Text Files, CSV Files, ODBC Sources, DAO Objects, ADO Objects) and are loaded into the variables inside the Test Script. Variables are used both for Input values and for Verification values. Test Scripts themselves are prepared either using Linear Scripting or Test Library Framework.

Demonstration of Data Driven Framework:
Creating multiple Google user accounts is the task we will try to accomplish using this framework.
In the example earlier, we hard coded the first name, last name, user id details etc. into our code while trying to create an account. We will have to separate the code from the data if we have to achieve data driving aspect for this script.
The data should come from a source that is not the program itself.
Typically the data input can be anything:
  1. MS Excel files
  2. Data base
  3. Text files
  4. XML files….etc.
Excel files are the ones that get used most often. The very fact that each action in QTP comes integrated with a data sheet of its own explains why that’s so.
You can use one or more data sources for a single script. The excel sheet that comes with the action can be used or you can use an external excel sheet too. Basically a data sheet can be any relevant external file.

For example:

This is the code that we need to data drive:
1. Browser("Gmail: Email from Google").Page("GoogleAccounts").WebEdit("FirstName").Set "ms"
2. Browser("Gmail: Email from Google").Page("Google Accounts").WebEdit("LastName").Set "v"
3. Browser("Gmail: Email from Google").Page("Google Accounts").WebEdit("GmailAddress").Set "DataTest"



After parameterizing the hardcoded values it will look like :

1.   Browser("Gmail: Email from Google").Page("Google Accounts").WebEdit("FirstName").Set DataTable("G_First_Name", dtGlobalSheet)
2.   Browser("Gmail: Email from Google").Page("Google Accounts").WebEdit("LastName").Set DataTable("G_Last_Name", dtGlobalSheet)
3.   Browser("Gmail: Email from Google").Page("Google Accounts").WebEdit("GmailAddress").Set DataTable("gmail_address", dtGlobalSheet)


Now the data can be kept in csv, xml or any other excel file.

Parameterization is a process for creating Data Driven Framework. As we can see in Data driven framework the data are kept separately from the script. Similarly we can also add the Output data we are verifying using the script.





Thursday, March 31, 2016

Selnium Webdriver: How to verify tool-tip using selenium-webdriver ?

Using selenium webdriver, How to capture tooltip ?

Capturing  tool-tip of element using web-driver script in java.  Tooltip is displayed in on the page only when user hover the mouse over it. Only then the related attributes can be identified in dev toolbar of browser. if we search for the title of toolbar then it cannot be located using dev-toolbar.

When user mouse hover on the text field, it will display the tool tip. But when you observer the HTML, it doesn't have any title attribute. When ever user mouse hover, it will generate a div tag in which tool tip text resides.

Steps to be automated are: 
1. Open url of the webapp.
2. Switch to Frame
3. Identify the element
4. Mouse Hover on the text field using Actions class
5. Get tool tip text by attribute :]]]]]]-------->>>> (for this step to get the tooltip user need to hover the mouse over the element, then div attribute is displayed (can be seen using dev toolbar) and using this attribute we can capture the tool tip. 

Following line of  java code ( with TESTNG) shows how it works using seleniun webdriver and its action class.


package Madhus.Example; import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; import org.openqa.selenium.firefox.FirefoxDriver; import org.openqa.selenium.interactions.Actions; import org.openqa.selenium.support.ui.ExpectedConditions; import org.openqa.selenium.support.ui.WebDriverWait; import org.testng.Assert; import org.testng.annotations.AfterClass; import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; public class Capturing_ToolTip { String seleniumURL = "http://docs.seleniumhq.org"; String jQueryURL = "https://jqueryui.com/tooltip/"; public WebDriver driver; @BeforeClass public void setUp() { driver = new FirefoxDriver(); driver.manage().window().maximize(); } @Test public void toolTipCase2() { driver.navigate().to(jQueryURL); // As there is frame, we have to navigate to frame WebDriverWait wait = new WebDriverWait(driver, 5); wait.until(ExpectedConditions.frameToBeAvailableAndSwitchToIt(By.cssSelector(".some-frame"))); // Text box field, where we mouse hover WebElement element = driver.findElement(By.id("id_name")); // Below steps will move the mouse on the required element and then get the attribute of
// element which appears after hovering the mouse. 

 // Use action class to mouse hover on Text box field Actions action = new Actions(driver); action.moveToElement(element).build().perform(); WebElement toolTipElement = driver.findElement(By.cssSelector(".Attributename")); // To get the tool tip text and assert String toolTipText = toolTipElement.getText(); Assert.assertEquals("This is the tooltip which will be located by this script.", toolTipText); } @AfterClass public void tearDown() { if (driver != null) { driver.quit(); } } }

Wednesday, March 30, 2016

Most Frequently Asked Questions during QA Automation Interview



About this doc..


This document is created with the intent of helping QA professional for interview questions related with Automation Testing, Selenium Web-driver, API Testing and some other basic questions asked frequently along with solution and example. This is the initial version and it will be improved over time and more and more questions will be added in it. Please add your questions and suggestions in the comments section.

This post covers topics on Automation Framework design  Automation concepts, selenium-webdriver, API Testing etc.











Table of Contents:
Title ............................................................................... Page No.
What is difference between soap and Rest API:
How to design automation framework or What are different kind of Automation frameworks which can be used for automation.? 7

                  

What are Page objects and what are its advantages:


The main advantage of Page Object Model is that if the UI changes for any page, it don’t require us to change any tests, we just need to change only the code within the page objects (Only at one place). Many other tools which are using selenium, are following the page object model.
Within your web app’s UI there are areas that your tests interact with. A Page Object simply models these as objects within the test code. This reduces the amount of duplicated code and means that if the UI changes, the fix need only be applied in one place.

Advantages:
There is clean separation between test code and page specific code such as locators (or their use if you’re using a UI map) and layout.
2. There is single repository for the services or operations offered by the page rather than having these services scattered throughout the tests.



Selenium webdriver:

Following keywords are used for handling alert related objects:

To accept Alert:
Alert alert=driver.switchTo().alert();
System.out.println(alert.getText());
alert.accept();
alert.accept
alert.getText
alert.sendkeys
alert.dismiss()
alert.notify() Will wake up the thread which depend on this. This thread should be the owner of object else it will throw exception “Illegalmonitorstateexception”.

Example showing how to handle frames on a webpage:

Switching to Frame:


public void switchToERCFrame(){
                        switchToInstallFrame();
                        WebElement frameERCs = driver.findElement(By.id("wdsFrame"));
                        driver.switchTo().frame(frameERCs);
            }


How to locate and Click on object inside Context-Menu of a page:

Steps

First identify the main object in context menu for eg “user-management.-> CreateUser” is context menu. When user hovers the mouse over user-management link then it displays the context menu with option like CreateUser, update, delete and search users.
For Automation of step “User move mouse over User-Managment link and then click on Create_User in the context menu following code illustrate how to do it using Web_driver (python script, similar in java code also)
Then move to element  main-object
Action.perform  (will move the mouse over user management and click on it)
Again identify/Locate the sub-obj in context menu and move to sub object using actions move to element
Action.perform               

Using ActionChain
# Below steps for locating and moving to a context menu on page for eg.: User-management menu.

actions =  ActionChains(self.driver);
mainMenu = self.driver.find_element_by_id("administrationMenu")
actions.move_to_element(mainMenu)
actions.perform()
time.sleep(2)
# Below steps for locating and moving to Create-user in context menu.
#actions =  ActionChains(self.driver)
submenu = self.driver.find_element_by_id("usersListMenu")
actions.move_to_element(submenu).click()                           
actions.perform()

         

Implicit and Explicit Wait. What are they and what’s the difference.


Implicit waits are used to provide a default waiting time between each consecutive test step/command across the entire test script. Thus, subsequent test step would only execute when the specified amount of time have elapsed after executing the previous test step/command.

Explicit waits are used to halt the execution till the time a particular condition is met or the maximum time has elapsed. Unlike Implicit waits, Explicit waits are applied for a particular instance only.


Working with objects changing values at runtime or Dynamic Objects:


For eg: if the object is located next to some label then it can be used to locate the dynamic obj.
//label1/following::input

 

Identifying the dynamic objects using the following methods:



1. Absolute XPath

Xpath Position or Absolute Xpath are most frequently used to resolve the dynamic element issues. Only problem with using XPath locators is that they are very fragile. They are most prone to breakage in case of change in web page. This factor could get worse exponentially as the test suite size and complexity increases. Below is an example of Absolute XPath and XPath Position

web_element_name=html/body/div[30]/div[2]/div[2]/div/div/div/div[1]/table/tbody/tr/td[2]/table/tbody/tr/td[1]/table/tbody/tr/td[1]/table/tbody/tr[2]/td[2]/em/button

//p[6]/label[2]/div/ins
2. Identify Element by starting Text

If the dynamic elements have a definite pattern to them, then we can also use JavaScript functions like “starts-with” or “contains” in our element locators to separate the dynamic part of locator from static part.

For example, in case of dynamic submit button Id example which we discussed earlier, we can apply ‘starts-with’ function to access this locator irrespective of its dynamic part.
XPath: //button[starts-with(@id, 'Submit-')]

3. Identify Element by containing Text

Similarly, in some scenarios where dynamic element is surrounded by a static value, we can use ‘contains’ function. For example we have following element locators…

<input class="new-userfield-001">
<input class="old-userfield-002">
As we can see ‘usefield’ part of element is static, so we can apply ‘contains’ function to access this element locator as shown below…
XPath: //input[contains(@class, 'suggest')].


4. Identify Element by Index
If there are multiple elements present on page with same locator then we can use following Java code in our selenium WebDriver script to interact with element of particular index.
driver.findElements(By.xpath(“//*submit”)).get(0).click();

5. Identify Element with reference of a closest stable element:

We can use the DOM structure to find the closest stable element first and then this stable element can be used as a reference element to find the required element.
XPATH: //span1/../following-sibling::div//button1
DOM structure could be found using Firefox extension like Firebug and FirePath. But in complex and large applications this approach is difficult to use because of large DOM structure.

6. Identify Element by stable preceding Text
Following method can be used for locating element which has changing attribute or dynamic properties and it doesn’t have any pattern or contains fix values. Where we cannot use startswith or contains.

Here we can locate the the element using static element nearby the object.
For web elements like text field and text areas we can identify them by using the stable text labels nearby. This approach might not be possible in all scenarios but it does resolve the dynamic element issues where possible. Example of this approach is shown below.
//label1/following::input


How to do right-click using selenium webdriver??

builder.contextClick(R1).sendKeys(Keys.ARROW_DOWN).sendKeys(Keys.ENTER).perform();


About Web Services:
Some common question for about Web Services. There is given frequently asked Web Services interview questions and answers that has been asked in many companies

1) What is Web Service?
Web Service is a software system for communicating two devices over the network.

2) What are the advantages of web services?

    Interoperability: By the help of web services, an application can communicate with other application developed in any language.
    Reusability: We can expose the web service so that other applications can use it.
    Modularity: By the help of web service, we can create a service for a specific task such as tax calculation etc.

3) What are the different types of web services?
There are two types of web services:
    SOAP
    RESTful


4) What is SOAP?
SOAP stands for Simple Object Access Protocol. It is a XML-based protocol for accessing web services.

5) What are the advantages of SOAP web services?
    WS Security
    Language Independent
    Platform Independent


6) What are the disadvantages of SOAP web services?

    Slow
    WSDL Dependent

7) What is WSDL?

WSDL stands for Web Services Description Language. It is a xml document containing information about web services such as method name, method parameter etc.

8) What is UDDI?

UDDI stands for Universal Description, Discovery and Integration. It is a XML based framework for describing, discovering and integrating web services. It contains a list of available web services. WSDL is the part of UDDI.

9) What is RESTful web services?

REST stands for REpresentational State Transfer. It is a architectural style. It is not a protocol like SOAP.

10) What are the advantages of RESTful web services?

    Fast
    Language Independent
    Platform Independent
    Can use SOAP.
    Allows different data format.


What is difference between soap and Rest API:

No.
SOAP
REST
1)
SOAP is a protocol.
REST is an architectural style.
2)
SOAP stands for Simple Object Access Protocol.
REST stands for REpresentational State Transfer.
3)
SOAP can't use REST because it is a protocol.
REST can use SOAP web services because it is a concept and can use any protocol like HTTP, SOAP.
4)
SOAP uses services interfaces to expose the business logic.
REST uses URI to expose business logic.
5)
JAX-WS is the java API for SOAP web services.
JAX-RS is the java API for RESTful web services.
6)
SOAP defines standards to be strictly followed.
REST does not define too much standards like SOAP.
7)
SOAP requires more bandwidth and resource than REST.
REST requires less bandwidth and resource than SOAP.
8)
SOAP defines its own security.
RESTful web services inherits security measures from the underlying transport.
9)
SOAP permits XML data format only.
REST permits different data format such as Plain text, HTML, XML, JSON etc.
10)
SOAP is less preferred than REST.
REST more preferred than SOAP.



Why API testing or Advantage of API testing?

  • Testing Complexity is Reduced:  
    •  By isolating a component from the rest of the application test preconditions are greatly reduced making it easier to write tests, and quicker to run them.
  • Testing without Source Code:
    •  Third party libraries are often delivered in binary form without source code. API testing allows the correct performance of the object code to be confirmed.
  • Negative and Error Testing
    • Often it is difficult or impossible to cause error conditions in a completely integrated system. API testing allows error conditions to be easily injected by controlling all inputs to the component.
  • Testing is Easily Automated
    • Because APIs can be controlled with scripted or compiled test code, it is much easier to automate tests.
  • API testing uncovers the issues faster then GUI testing. Issues are uncovered at early stage.
  • API Testing is language and platform independent. The response is returned either in xml or json irrespective of underlying language used for coding.
  • API testing can be performed even when UI is not ready and this also uncovers the potential issues at the earlier stage, which reduces the cost and effort for fixing these issues.
  •  Basic functionality is tested at logical layer. It test many functions and parameters which might not be available when testing on gui.
 


Difference between RPC (Remote procedure call) and Rest API.


The fundamental problem with RPC is coupling. RPC clients become tightly coupled to service implementation in several ways and it becomes very hard to change service implementation without breaking clients:
·         Clients are required to know procedure names;
·         Procedure parameters order, types and count matters. It's not that easy to change procedure signatures(number of arguments, order of arguments, argument types etc...) on server side without breaking client implementations;
·         RPC style doesn't expose anything but procedure endpoints + procedure arguments. It's impossible for client to determine what can be done next.
·         etc...
On the other hand in REST style it's very easy to guide clients by including control information in representations (HTTP headers + representation). For example:
·         It's possible (and actually mandatory) to embed links annotated with link relation types which convey meanings of these URIs;
·         Client implementations do not need to depend on particular procedure names and arguments. Instead, clients depend on message formats. This creates possibility to use already implemented libraries for particular media formats (e.g. Atom, HTML, Collection+JSON, HAL etc...)
·         It's possible to easily change URIs without breaking clients as far as they only depend on registered (or domain specific) link relations;
·         It's possible to embed form-like structures in representations, giving clients the possibility to expose these descriptions as UI capabilities if the end user is human;
·         Support for caching is additional advantage;
·         Standardised status codes;
There are many more differences and advantages on the REST side. 

REST vs RPC
REST is not a framework like WCF, a protocol like HTTP, a framework like JAX-RS, or a communication format like SOAP.  REST is an architecture, a structured way of representing a software solution - specifically, exposing aspects of a solution to a set of remote client-consumers.  The central tenet of REST is that these aspects of a solution can be modeled as resources which the client can consume or act upon.  

This resource-oriented thinking, and not the implementation details of how one communicates between client and server, is what REST is actually all about.  This is the key difference that separates actual RESTful APIs from RPC based on HTTP verbs.

Why is this important?
The RESTful approach enables us to model our domain objects as consistent, hierarchical URLs with predictable semantics mapping (loosely) to CRUD.  As well, HTTP comes with standard error codes, MIME types and generally does most of the heavy lifting, so we benefit from not needing to maintain a thick user-developed protocol stack that is subject to frequent modification.

Consider the following example of HTTP APIs that model orders being placed in a restaurant.  
  • The RPC API thinks in terms of "verbs", exposing the restaurant functionality as function calls that accept parameters, and invokes these functions via the HTTP verb that seems most appropriate - a 'get' for a query, and so on, but the name of the verb is purely incidental and has no real bearing on the actual functionality, since you're calling a different URL each time.  Return codes are hand-coded, and part of the service contract.
  • The REST API, in contrast, models the various entities within the problem domain as resources, and uses HTTP verbs to represent transactions against these resources - POST to create, PUT to update, and GET to read.  All of these verbs, invoked on the same URL, provide different functionality.  Common HTTP return codes are used to convey status of the requests.

Placing an Order:
  • RPC:  http://MyRestaurant:8080/Orders/PlaceOrder (POST: <Order OrderNumber="asdf"><Appetizer><Appetizer><Entree>Tacos</Entree><! --Rest of the order--></Order>)
  • REST: http://MyRestaurant:8080/Orders/Order?OrderNumber=asdf (POST: <Order><Appetizer><Appetizer><Entree>Tacos</Entree><! --Rest of the order--></Order>)

Retrieving an Order:
  • RPC:  http://MyRestaurant:8080/Orders/GetOrder?OrderNumber=asdf (GET)
  • REST: http://MyRestaurant:8080/Orders/Order?OrderNumber=asdf (GET)


___________________________________


Different Ways to Design A Framework
• Test Script Modularity Framework
• Data-Driven Automation Frameworks
• Keyword-Driven Automation Framework
• Hybrid Test Automation Framework

Test Script Modularity Framework
• Builds a abstraction layer in front of a component
to hide the component from the rest of the
application.
• Done by creating small, independent scripts.
• Each script represent modules, sections, and
functions of the AUT.
• Small scripts can be combined to from larger tests
• Results in high degree of modularization and
maintainability.

Data-Driven Automation Frameworks
• Test input and output values are read from
data files (ODBC sources, CVS files, Excel files,
DAO objects, ADO objects.
• These values loaded into corresponding
variables in captured scripts.
• Test flow navigation coded into test script.
• Thus script is just a "driver," or delivery
mechanism, for the data.

Keyword-Driven Automation Framework
• Requires the development of data tables and
keywords, independent of the test automation
tool.
• Essentially represents a manual test case as a
series of keywords or actions.
• In a keyword-driven test, the functionality of the
application-under-test is documented in a table
as well as in step-by-step instructions for each
test.

Hybrid Test Automation Framework
• Combination of all of the above techniques, pulling from
their strengths and trying to mitigate their weaknesses
• Allows data driven scripts to take advantage of the
powerful libraries and utilities in a keyword based approach
• The framework utilities can make the data driven scripts
more compact and less prone to failure.
• The utilities can also facilitate conversion of existing scripts
to keyword driven equivalents.
• On the other hand, the framework can use scripts to perform some tasks that might be too difficult to re- implement in a pure keyword driven approach.