Академический Документы
Профессиональный Документы
Культура Документы
This article discusses how we can convert an Object repository based script to DP based script. For this we will do a
simple recording of entering some text on Google.com search text box and clicking the Google search button
All the names used between "" are logical name of the objects in the Object Repository ("Browser", "Page",
"Google", "q", "Google Search") as shown in below image
Now let’s look the below statement and try and convert it to DP
Browser("Browser").Page("Google").WebButton("Google Search").Click
Converting WebButton("Google Search")
type = submit
Now to conver the WebButton("Google Search") to its DP counterpart we can use two different methods
Browser("Browser").Page("Google").WebButton("type:=Submit", _
"name:=Google Search", "html tag:=INPUT").Click
In this we first create a description of the object and then use it in the statement
Browser("Browser").Page("Google").WebButton(oGoogleSearch).Click
The later articles of this DP Part X series would be discussing in details when and where to use for which method.
For now just understand that both methods have their own advantage and disadvantages
DP Converted script
Browser("micclass:=Browser").Page("Page").Sync
Browser("micclass:=Browser").Navigate "http://www.google.com"
Browser("micclass:=Browser").Page("micclass:=Page").WebEdit("name:=q").Set _
"KnowledgeInbox"
Browser("micclass:=Browser").Page("micclass:=Page") _
.WebButton("type:=Submit", "name:=Google Search", "html
tag:=A").Click
Note: We will discuss more in details about micclass used above in later articles