Forum Discussion

ashly's avatar
ashly
Champion Level 1
2 days ago

Unintended actions during keyword test run

Hi, I am encountering a problem where TestComplete is performing unintended actions during a keyword test run, specifically clicking not only the intended tab but also some other unrelated icon or control. I have tried recording the same steps both with namemapping and without namemapping and the issue sill exist. 
while clicking on instrument tab, mouse click also happens on auto position adjust

while clicking on preference tab, mouse click also happens on prompts enabled

similar is the case with analyze tab. 
how can I solve this?

  • rraghvani's avatar
    rraghvani
    Champion Level 3

    You need to verify your name mapping and property values correspond to the UI object you are referring too. Verify that you are not using mouse coordinates, and ensure each of your actions are correctly defined.

  • ashly's avatar
    ashly
    Champion Level 1

    But I have also tried the same without namemapping and there also it failed. No mouse coordinates are used.

    • rraghvani's avatar
      rraghvani
      Champion Level 3

      I suggest you use the Object Spy tool on your UI object to see if they have unique properties. 

      What property and property values are you using to identify the UI object?

      Sometimes record and playback is not always 100% accuracy, and the name mappings need to be edited to instruct TestComplete to identify the correct UI objects

  • JDR2500's avatar
    JDR2500
    Frequent Contributor

    This is an interesting problem for sure.  You may indeed be able to sort it out by looking at the object properties or the specifics of the line in the Keyword test that is executing the click.

    However, another avenue is to take a different approach.  Often in TestComplete the same thing can be accomplished by more than one method.  In this case I would suggest trying the Keys method to accomplish selecting the tab you want.

    The first step is to see if your application supports keyboard access to the tab.  With focus on you application press your Alt key.  If the application supports keyboard accelerators for the tabs you should see them displayed something like below.

    Here you can see "H" selects the Home tab, "I" selects Insert and "T" selects Tools.

    If you see them then this approach will likely work.  In your keyword test you'll want to select the "Call Object Method" entry in the Test Actions list.  Then select the main application window as the object.  From the list of methods choose "Keys"

    For the value enter "~" followed by whatever keys(s) your application showed for that tab.

    Click "Finish" and run it.  Hopefully it works.