Forum Discussion

aceishigh's avatar
aceishigh
Contributor
14 years ago

Unable to Identify Popup Menu Item in IE8

TestComplete: 8.70.727.7

Browser: IE 8



I'm using xpath to identify web elements and TC doesn't seem to be able to identify and click on the popup menu item I want.



Steps:

1. Click on a button to show the popup menu - this works fine.

2. Try to click on the menu item (the menu item is a <td> table element). This is the code I'm using where AddComputer is the id of the TD element.



AddComputerObj = objProcess.Page("*").EvaluateXPath("//*[@id='AddComputer']")

AddComputerObj(0).Click




The log reports the following error:

"There was an attempt to perform an action at point (0, 0), which is out of the window bounds."



Any help would be very much appreciated.

A.

1 Reply

  • 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:

    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