'The following example retrieves the collection of WebEdit objects in order to find a
specific WebEdit object in a page and set a value for it.
Dim EditToSearch, ValueToSet, NumberOfEdits
'This is the value of the 'name' property for the WebEdit object we want to find.
EditToSearch = "credit_card_number"
ValueToSet = "3558986773230578"
'Create a description object to help retrieve allWebEdit objects in a specific page.
Set oDesc = Description.Create()
oDesc("micclass").Value = "WebEdit"
oDesc("name").Value = "credit_card_number"
'Retrieve all WebEdit objects in this page
Set EditCollection = Browser("Book a Flight: Mercury")_
.Page("Book a Flight: Mercury").ChildObjects(oDesc)
NumberOfEdits = EditCollection.Count
'Search for a specific WebEdit object and set its value
For i = 0 To NumberOfEdits - 1
If EditCollection(i).GetROProperty("name") = EditToSearch Then
EditCollection(i).Set ValueToSet
End If
Next
No comments:
Post a Comment
Note: only a member of this blog may post a comment.