11-18-2013 08:53 AM
I created a function that I use to click a link on a web application web page. When I run the function using IE it works but when I run it on FF I get an error message stating: that this object does not support this property or method.
Here is my code: All help would greatly be appreciated.
Public Function ClickLink(BName,PName,LinkText)
'This will grab all of the links in the page.
Set oAnchors = Browser(BName).Page(PName).Object.GetElementsByTagName("A")
blnFound = False
For Each oAnchor in oAnchors <-Here is where I get the error in FF
'Use some property to identify which link you are on 'And if it's the right one
If oAnchor.innertext = LinkText Then
blnFound = True
Set oAnchor = Nothing
If blnFound = True Then Exit For
Set oAnchors = Nothing
11-29-2013 06:49 AM
If you still need assistance, please check following known limitation when working with Firefox, which I suspect of being the cause of the problem:
(from following article: http://support.openview.hp.com/selfsolve/document/
The Object property accesses DOM objects
- For details on the Internet Explorer DOM, see http://msdn.microsoft.com/en-us/library/ms533022.a
- For details on the Firefox DOM, see https://developer.mozilla.org/En/DOM
As a workaround, I would suggest you use a Description object as follows:
Public Function ClickLink(BName,PName,LinkText) Set oDesc = Description.Create oDesc("micclass").Value = "Link" Set links = Browser(BName).Page(PName).ChildObjects(oDesc) blnFound = False For i=0 To links.Count - 1 If links.Item(i).GetROProperty("innertext")= LinkText Then links.Item(I).Click() blnFound = True End If If blnFound = True Then Exit For Next Set oDesc = Nothing Set links = Nothing End Function
Let me know if this works for you.
If you find that this or any post resolves your issue, please be sure to mark it as an accepted solution.”