There might be cases where you want to enter the same value in all the objects of the same class like an edit box. This is particularly useful when checking for field level validations. The approach to be followed can be to identify all the childobjects in the page belonging to the same class, and then trying to set the value or retrieve a value. The below piece of code can be used to enter the same text in all the WebEdit objects in the YahooMail page.
Set objIE = CreateObject("InternetExplorer.Application")
objIE.Visible = True
objIE.Navigate "www.yahoomail.com"
Browser("Google").Page("Yahoo! Mail: The best").Sync
Set objDesc = Description.Create
objDesc("micclass").Value = "WebEdit"
Set Child = Browser("Google").Page("Yahoo! Mail: The best").ChildObjects(objDesc)
For iCount = 0 to Child.count -1
Child(iCount).Highlight
Child(iCount).Set "Divya Rakesh"
Next
No comments:
Post a Comment