Forum Discussion

ashly's avatar
ashly
Champion Level 1
31 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

      • ashly's avatar
        ashly
        Champion Level 1

        where can I find the object spy tool

         

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

  • Hassan_Ballan's avatar
    Hassan_Ballan
    Frequent Contributor

    Hello ashly 

    I understand from your description that your single click action is performing two independent click actions, and that is for sure interesting and illogical.

    To help you isolate and probably make sense of it:

    1. Reboot
    2. In a new test project, record only the single click action
    3. How many KeywordTests Item and what Operation? I would assume a single Click Item
    4. Select that Item and right click, and from the speed menu select and run a) "Highlight on Screen" and b) "Run Selected Operation"
    5. From the log, view the picture to see where TestComplete clicked
    • Did TestComplete recording include only a single Click Item or two Click Items?
    • Did "Highlight on Screen" and "Run Selected Operation" execute as expected?
    • What do the log statement and picture tell you?
    • ashly's avatar
      ashly
      Champion Level 1

      hi, I have rebooted the system and in a new project suite I created a new test project and recorded the keyword testcase. I have created it as one keyword test.

       
      When I selected that item and selected "Highlight on Screen", it selected the entire ribbon menu and not specifically the tab that I selected. When I selected "Run selected operation" the operation has worked by clicking the intended tab but also some other unrelated icon. In the namemapping session, the name of these objects haven't yet come. I will attach the log for reference. This is the log generated when I run the selected operation only.

       

      • Hassan_Ballan's avatar
        Hassan_Ballan
        Frequent Contributor

        For proper identification I would expect it to highlight the intended item and not the entire ribbon. TestComplete usually clicks in the center of the recognized screen highlighted object. I am not experienced in desktop applications ribbon.

        Right click on the KeywordTest Item and select "Show Object in Name Mapping Editor" to view the recognition details. Also, for that highlighted Mapped Objects Aliases node, on the parent and child nodes, again you can right click to select Highlight. Recognition needs to be manually adjusted by editing to suite your needs, and I suggest you follow rraghvani instructions. Or come up with a work around as JDR2500 suggest.