Wednesday 30 July 2014

Golden Rules For QTP Starters

                    Hi Friends, I noticed much more comments on the Forums& Other sites, Those are, Why QTP showing error, How to start recording,.......Etc. For that i would like to share some information for freshers. It is not only for freshers, But also for experienced people. Even well known people also some times doing some mistakes. So try to fallow below 6 Rules. To avoid the QTP run time exceptions(errors). 


1) Open QTP with appropriate Add-in
2) Open the SUT manually, Then start QTP Recording
         SUT= Software Under Test
3) You should record on the opened SUT only
4) While recording, Try to avoid Key Board shortcuts
      like Tab, Enter, Backspace....Etc
5) Before starting the test script execution, Make sure application status
        Application status means where we started the recording, That state
6) While executing the script, we should arrange One Appropriate application Only.




For any Doubts Comment Here 

Sunday 27 July 2014

QTP All Files Extensions& How To Associate Those Files In Run Time to Current Test

Hi Friends it is very useful to who want to write QTP Certification test& Along with who are trying jobs on QTP. 

Polineni












We can use below code, To Associate the Function Library In run time to QTP test

'qtpo= QTP Object, to open QTP
'flo=Function Lib, for Add to test
Set qtpo = CreateObject("QuickTest.Application"
 qtpo.Launch
 qtpo.Visible = True
 'Open the test
 qtpo.Open"D:\GUITest2"
 Set flo = objQTP.Test.Settings.Resources.Libraries
  'Associate Function Library if NOT associated already.
 If flo.Find("C:\lib1.vbs") = -1 Then
   flo.Add "C:\lib1.vbs"1
 End

We can Use below code, TO associate the Recovery Scenario in Run-TIme to QTP Test 


'qtpo= QTP Object, to open QTP
'rso=Recovery Scenario object, to add in run time
Set qtpo = CreateObject("QuickTest.Application"
 qtpo.Launch
 qtpo.Visible = True

 Set rso=qtpo.Test.Settings.Recovery
 If rso.count>0 Then
     rso.RemoveAll
 End If
 rso.Add"File path","Scenario name"
  

Saturday 26 July 2014

ToolTip Validation Using QTP

                 Hi friends now a days all of the clients are giving much priority for application Usability, Nothing but usability testing. In the part of usability testing we need to validate Tool Tips of AUT/SUT. Earlier days we did this Tool Tip Validation manually only. But now we can perform that task using automation tools like QTP/UFT.      

               So for that i would like to show different ways


Way 1:=
browser("title:=.*").page("title:=.*").webelement("Xpath:=.*").mouseover
Var=window("nativeclass:=tooltips_class32").GetROProperty("text")
MsgBox Var

Way 2:=
browser("title:=.*").page("title:=.*").webelement("Xpath:=.//*[@id='hplogo']").FireEvent"onmouseover"
Var=window("nativeclass:=tooltips_class32").GetROProperty("text")
MsgBox var

           I think you may know the above syntax to capture Tool Tips. But while executing the test we need to arrange mouse over on the required test object manually, Then only QTP can read the Tool Tip.


Way 3:=          
var =browser("title:=.*").page("title:=.*").webelement("Xpath:=.//*[@id='hplogo']").Object.title
MsgBox Var

The above code also can read the Tool Tips of some test objects some times only. 
       
         But The below code can work on any test object any time, With out any human interception while executing script. 

Way 4:=

 Setting.webpackage("replaytype")=2
browser("title:=.*").page("title:=.*").webelement("Xpath:=.//*[@id='hplogo']").FireEvent"onmouseover"
Var=window("nativeclass:=tooltips_class32").GetROProperty("text")
MsgBox var
Setting.webpackage("replaytype")=1

  

Any Doubts or any issues leave a comment...!