micclass
micclass represent the type of QTP test object. Let’s take a look at below code
'Displays page
MsgBox Browser("Browser").GetTOProperty("micclass")
'Displays Page
MsgBox Browser("Browser").Page("Google").GetTOProperty("micclass")
To generalize we can say micclass of a QTP Test object is always the object keyword name we use. So WebXXX("YYY") will have micclass as WebXXX
Dummy Properties
When in DP Part 1 article we converted the Browser statement we use
Browser("micclass:=Browser").Navigate "http://www.onestopsoftwaretesting.com/"
Now I call this micclass:=Browser a dummy property because as soon as I say Browser("XXX") it already implies that the micclass of the object is Browser. So why did we use micclass? Reason being that the Browser object in the object Repository didn’t had properties define as we had only one browser opened at time of replay. So to represent a unique/single instance object in DP we cannot use something like below
'Below is an invalid statement
Browser("").Navigate "http://www.onestopsoftwaretesting.com/"
'Below is an invalid statement
Browser().Navigate "http://www.onestopsoftwaretesting.com/"
We need to specify atleast one property in case of DP. So we use a dummy property micclass as the convention
Browser("micclass:=Browser").Navigate "http://www.onestopsoftwaretesting.com/"
No comments:
Post a Comment