Forum Discussion
aceishigh
14 years agoContributor
Got this sorted. The xpath expression was actually returning 2 matching objects and not 1 as expected. I'm guessing it must be some hidden web element. Anyway, once I changed my code to click on the second element, it worked fine.
SystemsObj(1).Click
If you want to find out how many objects your expression is returning, just run the following check:
Thanks,
John
SystemsObj(1).Click
If you want to find out how many objects your expression is returning, just run the following check:
AddComputerObj = objProcess.Page("*").EvaluateXPath("//*[@id='AddComputer']")
If VarType(AddComputerObj) <> varNull Then
Log.Message("Objects found: " & (UBound(AddComputerObj) - LBound(AddComputerObj) + 1))
Log.Message("First object name: " & AddComputerObj(0).FullName)
Else
Log.Message("No matching objects found")
End If
Thanks,
John