Friday, May 1, 2015

Program to Reverse the words from the string

'Program to Reverse the words from the string
'Created by Zeeshan

strName = "Hello Everyone"
arrayq =split(strName," ")
For i=ubound(arrayq) to 0 step-1

strNew =strNew+" "&arrayq(i)

Next
print strNew

Program to calculate the count of each chatacter from the string

'Function to find the each character count from the given strings
'Created by :Zeeshan

'Declare the Variable
Dim strName
iSum = 0
strName ="zeeshan"

'Apply the For Loop till the length of the string
For i=1 to len(strName)
    iSum = i

'Create the Object of Regular Expression
    Set Regex =new RegExp
'Find out the each character from the left side of the screen
    Str = left(strName,1)
    Regex.Pattern =left(strName,1)
    Regex.IgnoreCase =True

'Apply the condition if length of the string is zero then loop will be closed
If len(strName)=0  Then
    Exit For
    End If

'Calculate the length of the Original string
OldString = len(strName)

'Replace the retrieve character from the null value
strName =Regex.replace(strName,"")
Print strName
'Calculate the length of the string after applying replace function
NewString =len(strName)
StrDisplay = StrDisplay & Str & (OldString-NewString)
Next

print "Loop Executed"&" "&iSum&" "&"Times"
Print "Count of each string would be-"&StrDisplay

Some Questions and Answers that very frequently ask in Interview

Q1. In UFT how you can prevent the system from getting locked?
 Ans. To prevent system getting locked, any of the two ways can be used
  • Create a simple vbs file having code to press numlock key and run that vbs file
  • Edit one registry key “DisableLockWorkstation =1” to disable locking

    Q2. How we can find out the Total execution time of the test case?
    Ans. We can use the below code

    Teststart =now()

    'Test steps

    Testend =now()
    TotalTime =datediff("n",Teststart,Testend)
    Print TotalTime

    Q3. How we encrypt any value in QTP for security purpose
    Ans.

    pwd= "Password"
    pwd = Crypt.Encrypt (pwd)
    print pwd

    Q4.What Coding standards we have to follow during writing any function
    Ans.
    1. Variable Naming Convention
    2. Function name should be related to Function
    3. Since we are automating manual test case to QTP scripts, So scripts should be Manual Test scripts name in QTP
    4.Each Action, Function, Scripts should have
    Created Date
    Created By
    Purpose
    Modified

    Q5. What is the difference between the Systemutil.Run and InvokeApplication?
    Ans.  Systemutil.Run method can open any kind of application but Invoke application method is used for only exe file.

      Wednesday, April 29, 2015

      Program to find the Unique String from the array

      'Program to find the string with the unique number of element. in the below example i have one array and i have eliminate the duplocate elemnet and generate the sting with unique elements
      'Created by Zeeshan Khan
      '-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
      'Declare the array
      dim a

      'Assign the elements to the array which having 2 times 1
      a= Array (1,2,3,1)

      'Find the array Length
      Arraylngth =ubound(a)

      'Initialize the variable strfromArray with blank value
      strfromArray=""

      'Move the For loop for each index and get the value from array than concatenate these values and store in a one Variable
      For i=0 to Arraylngth
      strfromArray =strfromArray&a(i)
      Next

      'Below line of code is just to check what would be type of the variable
      print TypeName (strfromArray)
      Print "Concanated string from the array is now-->"&strfromArray

      'Initialize the Counter
      Counter=0

      'nitialize the variable strUnique with blank value
      strUnique =""
      For j=1 to len(strfromArray)
      If strcomp(mid(strfromArray,j,1),"1") = 0 Then
      Temp = (mid(strfromArray,j,1))
      counter =counter+1
      If (counter>1) Then
      strReplacedString=replace(strfromArray,mid(strfromArray,j,1),"")
      Print "String after the replacing the repititive element is-->"&strReplacedString
      End If
      End If
      Next
      print "Final Unique string without any duplicate element is" &Temp&strReplacedStringere.
       
       
       

      Monday, April 27, 2015

      Effort Estimation |Automation Testing

      Hi Guys,

      Effort estimation is a very important part of success of any project and our estimation will correct than our automation task would be complete in proper manner and in calculated time.

      Here i m discussing effort estimation for development of automation script.

      1. First we analysis the manual test cases and find out the good automation candidate than take out the complexity of the test cases.Complexity will be decide on the basis of some parameters and those parameters are :

      a.) No. of Verifications
      b.) No of actions or Screen navigation.
      c.) No. of Iteration

      Complexity would be Complex, Medium and Low.

      for  example


      Complexity
      No. of Screens
      Verifications
      Iterations
      Low
      < 5
      < 5
      >  15 execution
      Medium
      >5 -  <15
      >5 – <10
      > 8 – 10 execution
      Complex
      >15 – <25
      >10 – < 15
      > 5 – 8 execution

       
      Now on the basis of Complexity we will decide the time and one important thing dont forget to add buffer time in your effort estimation.

      If we are going with the mathematically formula than formula would be.

      T = (n1*t) +(n2*t)+(n3*t)

      T --> Total time for the development of test script
      n1-->Number of test cases of Low Complexity
      n2-->Number of test cases of medium Complexity.
      n3-->Number of test cases of Complex Complexity

      So guys i have tried to explain how we can calculate the effort estimation of development task of Automation script.

      One Important thing, any development of test case automation we have to do following task, so while calculating effort estimation please keep below steps in your mind.

      1.Test Case execution (Manual)
      2.Test data selection
      3.Script Template creation
      4.Base scripting
      5.Implement framework elements
      6.Script execution for dry run

      In the next post i will share you , how we can select the test cases for Automation

      Sunday, November 16, 2014

      WebApplication Testing on Mobile Browser

      Mobile Testing

      Todays life is fully dependent on Mobile devices  and because of that most of the organization are started to launch their applications on Mobile devices to attract the mobile users and thats why Mobile testing come into the picture.

      There are Lots of tools are available in the Market for the automation of Mobile application on Android or iOS.

      Some freeware tools are listed below:

      1. Appium (This is configured with the Selenium Webdriver)

      2. Selendroid (This is also configured with the Selenium Webdriver)

      Licensed Version tools are listed below that are supported by QTP.

      1. PerfectoMobile ((a.)This tool provide all the devices on Clouds (b)This is the Co-Partner of HP for Mobile testing (c))

      2. SeeTestAutomation ((a) This tool is only supported by UFT and above version of QTP 11.0 (b) UFT add in for Web-application testing on Mobile browser will be launced in Nov 2014 ,still this tool is supported only for Mobile application)

      More details on the above tools will be published in Next Blog

      Tuesday, June 4, 2013

      Selenium - Most Demanding Tool Now

      Now these days selenium get more popular, because this is Open source tool and this tool provided you better compatibility testing, for example you can test your application on different browser and also on different OS.

      Selenium Web driver is basically supported various languages and this is the main advantage of the Selenium. but limitation with that this is applicable only for the web based application not for the windows.

      Language Supported by the Selenium are:
      Jave
      C#
      PHP
      PERL
      PYTHON
      RUBY

      Most demanding combination is Selenium with Java

      Download the Selenium Webdriver from the given Location:
      http://docs.seleniumhq.org/download/

      Please click on the Download Link against the JAVA. 












       After download of the same , a folder has been created as mention below :
      Name that folder as "selenium-java-216.1"

       Open it and there a folder named as lib--These are the files which we have to map with Eclipse