Monday, January 7, 2019


GetROProperty Method in UFT

   
                    GetROProperty method is used to identify an object in an Run time, It retrieves the properties and values where the QTP is recorded also the property is listed in the script. 

Here we can see the few examples that how the Getroproperty is work for an real time applications.
Below scripts will get the entire object properties in a msgbox for the declared unique properties in the scripts. So that we can ensure those object Properties are present in the application.

'www.google.com

Set wsh=Createobject("wscript.shell")
Set olink=Description.Create
olink("micclass").value="Link"
Set olinkcoll=Browser("name:=Google").Page("title:=Google").ChildObjects(olink)
'The script will pass the total number of links present in the message box
msgbox olinkcoll.count
For i=0 to olinkcoll.count -1
lslink=olinkcoll(i).getroproperty("name")
lsurl=olinkcoll(i).getroproperty("text")
wsh.Popup lslink,1,"The link name is"
wsh.Popup lsurl,1,"The url of the link is"
Next

'www.yahoo.com

Set wsh=Createobject("Wscript.Shell")
Set olink=Description.Create
olink("micclass").value="Link"
Set olinkcoll=Browser("name:=Yahoo! India").Page("title:=Yahoo! India").ChildObjects(olink)
'The script will pass the total number of links present in the message box
msgbox olinkcoll.count
For i=0 to olinkcoll.count-1
lslink=olinkcoll(i).GetROProperty("name")
lsurl=olinkcoll(i).GetRoproperty("Link")
wsh.Popup lslink,1,"The Link name is"
wsh.Popup lsurl,1,"The url of the link is"

'www.rediff.com

Set wsh=CreateObject("Wscript.Shell")
Set olink=Description.Create
olink("micclass").value="name"
Set olinkcoll=Browser("name:=Rediff.com - India, Business, Stock, Sports, Cricket, Entertainment, Bollywood, Music, Video and Breaking news, Rediffmail NG, Shopping").Page("title:=Rediff.com - India, Business, Stock, Sports, Cricket, Entertainment, Bollywood, Music, Video and Breaking news, Rediffmail NG, Shopping").ChildObjects(olink)
'The script will pass the total number of links present in the message box
msgbox olinkcoll.Count
For i=0 to olinkcoll.count-1
lslink=olinkcoll(i).GetROProperty("name")
lsurl=olinkcoll(i).GetROProperty("Link")
wsh.Popup lslink,1,"The link name is"
wsh.Popup lsurl,1,"The url of the link is"
Next

'Default flight Application


Dlgname=Dialog("nativeclass:=#32770").GetROProperty("text")
msgbox Dlgname
lsbtnstatus=Dialog("text:="&Dlgname).winbutton("text:=OK").getroproperty("enabled")
If lsbtnstatus Then
msgbox "PASS"
End if

Related Posts:

  • Priority and Severity in Testing. Severity and Priority in Testing? As usually, Tester select Severity of bugs and Project lead or project manager selects bug priority. Priority - Priority is the order in which developer has to fix the bug. Severity … Read More
  • UFT Real time Scripts 2020 For more QTP Realtime Scripts,  MS Excel Scripts '''Script to create a new excel file , write data '''save the file with read and write protected '''''pwd1 is for read protected pwd2 is for write protected Set xl=Crea… Read More
  • UFT Keyboard Shortcut commands UFT Keyboard Shortcut commands  Frequently Used Shortcut keys: To comment block of statements: Ctrl+M To uncomment block of statements: Ctrl+Shift+M To apply “With” to script: Ctrl+W To remove “With” from script: Ctrl… Read More
  • Outcome of Running the QTP Scripts Outcome of Running the QTP Scripts Report in UFT 1. Test Fusion Report: 2. Customized Report (Framework):… Read More
  • UFT 220 interview questions 2020 UFT 220 interview questions and answers 2020 Automation testing UFT 220 interview questions and answers 2020 Q. 1: What is Automation Object Model in QTP? Like we use QTP for automating the testing of our applications, we … Read More

0 comments:

Post a Comment

Blog Archive

Translate

Popular Posts

Total Pageviews

150,585

Blog Archive