Saturday, December 26, 2015

Steps to Start Automation.

Automation testing is very useful technique to perform functional testing very fast and this is very useful for regression perspective.

Off course we need Automation tool knowledge to start the development or execution of automation scripts but very important is planning , how we can start our automation so we can achieve our goal.

So to day i will discuss the Automation process in detail

Step1. We need to analysis the application first irrespective of following paramaeters
  a.) Need to understand the environment on which application is developed, so we can think which tool is compatible with that environment.

b.) Are objects in the application is identified.

c.) We also need to know that application is stable or not, because automation would be better on stable application.

d.) Need to select the framework which is suitable for your application.

Step2. Proof of concept for business flows (POC)
 a.) Verify all the objects in the application can be identified

 b.) Verify interaction with the application.'

 c.) Developed the few scripts and Validate automation of sample workflows.

Step3: Design the Automation Framework

 a.) Select the Automation framework, it could be Hybrid, data-driven or keyword driven framework etc.

 b.) Define how we can work with objects it could be using object repository, descriptive programming,Using DOM and combination of two or more approaches.

 c.) Result /Execution reporting - We have to decide how we can get or use the result, it could be QTP Generated results or we can create a user defined results(Custom report)

 d.)  Need to specify how we can handle the error and unwanted errors with the use of recovery scenario.

 e.) Need to specify how we can manage the test data, it could be from external file like excel or we can use data table of QTP.

Step4: Develop the Automation test script


 a.) Create the test script as per the developed framework.
  
 b.) Perform dry run of automated test cases.

Step5: Execute the test script 
  a.) In this process we have to define that how we can execyte our QTP Script. it could be executed with the use of Driver script or may it could be executed with the use of QC/ALM.

 b.) Run test and anaysis the result.

Step6 : Maintenance and Support

 a.) Made changes in script for application changes.

 b.) Add test script to existing regression suite. 

Thanks...................Will publish another topic soon



Saturday, December 19, 2015

Interview Question on Mobile Testing

Ques1: How many type of Mobile application?
Ans: Mobile application are of three types"
1. Native apps
2. WebApps
3. Hybrid apps

Native apps, the most common form, are applications built to run on a specific mobile device’s hardware, sometimes with and sometimes without a data connection—like the Kindle app, for example, or Angry Birds. Web apps, however, almost always require a data connection, are usually designed to run across all platforms using the same basic code, and are really not “apps” in the app-store sense but are simply, as the name suggests, web-based applications.  The difference between an ordinary website and a web app in this context, though, is that these apps range from mobile-friendly versions of websites to websites that are custom-built (usually with HTML5, JS, CSS), from the ground up, specifically for display and use on mobile devices. Finally, with regard to hybrid apps, these are essentially web apps packaged in a native-app wrapper—available in app stores and designed for use only on mobile devices, but also relying heavily on communication with a website or web-hosted database, such as via APIs, in order to function at all.  (One common example is the Wikipedia app, which requires an active connection to Wikipedia.org’s online database to deliver its Apache Lucene search results.)

Quse2:Extension of applications developed in different Platform
Ans: ios application ---> *.ipa
        Android application ----> *.apk
        Blackberry ---> *.jad
        Windows----->*.exe

Ques3: What are some tool that we use to see the logs of the application
Ans:We can use monitor.bat file located under tools folder of andorid sdk to see log and we can select and save the log from it other than thi alogcat is a free log getting tool which is present in GooglePlay.

Ques4: Important checks while Mobile application testing
1.      Installation testing (whether the application can be installed in a reasonable amount of time and with required criterion)
2.      Uninstallation testing (whether the application can be uninstalled in a reasonable amount of time and with required criterion)
3.      Network test cases (validation of whether the network is performing under required load or not, whether the network is able to support all the necessary applications during the testing procedures)
4.      Check Unmapped keys
5.      Check application splash screen
6.      Continued keypad entry during interrupts and other times like network issues
7.      Methods which deal with exiting the application
8.      Charger effect while an application is running in the background
9.      Low battery and high performance demand
10.  Removal of battery while an application is being performed
11.  Consumption of battery by application
12.  Check Application side effects

Ques5: How to test CPU usage on mobile devices?

Ans. There are various tools available in the market like google play or app store from where you can install apps like CPU Monitor, Usemon, CPU Stats, CPU-Z etc these are an advanced tool which records historical information about processes running on your device

Created by Keensmartz solutions

Thursday, December 10, 2015

Known errors while reading the Text file with the use of File System Object

1. Some time we face the error as "Bad file mode" while reading the text file from the particular location. if we execute the below code than this error will generate.

filename = "D:\Test.txt"
strmode = 2
Set o1 = Createobject("Scripting.Filesystemobject")
If o1.FileExists(filename) = true Then
    set r1 = o1.OpenTextFile (filename,strmode)
 else
    ExitTest
End If
Msgbox r1.readall()


Above error is generated because of invalid file mode while reading the file,becuase in above code we selected the mode as 2 and it means this text file is open in write mode.
To avoid this error we have to open the text in to the read mode i.e "1"


2. Some time we face the error as "Input past end of file" .while reading the text from the notepad file.

Above error is generated when we try to read the empty notepad file.


How to select the Multiple value from the WebList - QTP

QTP Provide the easiest way to select the Multiple values from the dropdownlist with the use of ExtendSelect Method. Will easily understand with the use of below example.

Application with the Weblist

Keep all the values in an array and write the below code to select the values

Dim a
a =array("mushrooms","green peppers","olives")
lengthofarray = ubound(a)
msgbox lengthofarray
Browser("Browser").Page("Page").WebList("toppings").Select a(0)
   For i =1 to  lengthofarray
      Browser("Browser").Page("Page").WebList("toppings").ExtendSelect a(i)
  Next

Out put After executing the code

Output

Wednesday, October 7, 2015

How to verify the text into the Whole WebPage

set objpage = Browser("Google").Page("Google")

set objpage = Browser("Google").Page("Google")


msgbox   VerifyTextPresentOnPage(objpage ,"zeeshan" )

'-----------------------------------------------------------------------------------------------------------------------------
'Functioen name : VerifyTextPresentOnPage

'Created by  : Zeeshan Khan

'--------------------------------------------------------------------------------------------------------------------------------
Function VerifyTextPresentOnPage(objpage ,Textvalue )


'Child object description
Set childobjdes = Description.Create()
childobjdes("micclass").value="WebElement"
childobjdes("html tag").value=".*[A-Za-z0-9].*"
childobjdes("outertext").value =".*[A-Za-z0-9].*"

'Get ALL child object
set allobj = objpage.ChildObjects(childobjdes)
'get all  web element  outer text from web page and store in output variable
For i=1 to allobj.count-1
output=  output   & allobj.Item(i).GetROProperty("outertext")
Next
'now compare the value if the given value find or not
print output
If instr(1,lcase(output),lcase(Textvalue)) > 0  Then
'return true if found
VerifyTextPresentOnPage= True
Print VerifyTextPresentOnPage
Else
'return true if  not found
VerifyTextPresentOnPage= False
Print VerifyTextPresentOnPage
End If
End Function

Sunday, September 27, 2015

Working on Webtables in Selenium with the use of Java

What is Webtable?
Web tables are basically group of elements that are logically stored in a row and column format. 
  1.  If we know that number or rows and Columns are fixed than we will use the below approach
1for(int numberOfRows=1; numberOfRows<=5; numberOfRows++)
2{
3for(int numberOfCol=1; numberOfCol <=3; numberOfCol++)
4{
5System.out.println(driver.findElement(By.xpath(“//div[@id='main']/table[1]/tbody/tr[“+numberOfRows+”]/th[“+numberOfCol+”]”)));
6}
7}

  1.      How to work with the dynamically changed webtables?
1WebElement htmltable=driver.findElement(By.xpath("//*[@id='main']/table[1]/tbody"));
2List<WebElement> rows=htmltable.findElements(By.tagName("tr"));
3 
4for(int rnum=0;rnum<rows.size();rnum++)
5{
6List<WebElement> columns=rows.get(rnum).findElements(By.tagName("th"));
7System.out.println("Number of columns:"+columns.size());
8 
9for(int cnum=0;cnum<columns.size();cnum++)
10{
11System.out.println(columns.get(cnum).getText());
12}
13}