Forum Discussion

sborno's avatar
sborno
Occasional Contributor
20 days ago

Problems by validating a tooltip of a wpf application

Dear community,

I've encountered the following issue with a keyword test, as shown in the attached picture:

The keyword test consists of 6 steps: Lines 1 to 4 and Lines 6 to 7. Line 5 is a manual interruption by the tester. The script in Line 6 triggers the visibility of the tooltip (of Component1), while the script in Line 7 validates the tooltip.

Everything works perfectly if:
- The tester executes the keyword test and stops at Line 5 using a breakpoint.
- Subsequently, the tester resumes execution from Line 6 using the context menu item "Run from Selected Operation".

However, the keyword test fails to find the tooltip if:
- The tester executes the keyword test without stopping, so Lines 1 to 5 and Lines 6 to 7 are executed consecutively.

What is the difference between these two scenarios?

What could be the root cause of this problem and how can it be resolved?

Thank you for your responses in advance!


- Currently we use the TestComplete version 15.62.2.7 x64
- The tooltip is visible in both cases

  • JDR2500's avatar
    JDR2500
    Frequent Contributor

    Is displaying the tooltip a requirement of your validation?  The reason I ask is you can probably verify the text without displaying it.  The text is likely a property of the control itself.  In my below example you can see the tooltip as a property of the WPF button.

     

    • sborno's avatar
      sborno
      Occasional Contributor
      Hi, JDR2500
       
      Thank you for your answer!
       
      The display of the tooltip is mandatory requirement. The visibility of the tooltip on the screen does not seem to be the problem here either.
       
      The complex tooltip object could be grapped in both cases, but most of it's properties are having the value "Error: the object invoked has disconnected from its clients" in the second case.
       
      It is visible on the screen in both cases, so how can the object always be retrieved with valid properties?
       
      The visibility of the wpf object is triggered by bindings and the object is defined like this:
      ListBox -> DataTemplate -> Canvas -> Canvas.ToolTip
       
      Furhermore it doesn't matter if the command "Process.Refresh()" is deactivated or not.
      Any ideas what could be the source of the problem and how to solve it? - Thanks a lot!
  • It sounds like a timing issue. Try putting a really long delay between lines 5 and 6 and see if it will run though automatically then. If that works, then you can either try shorter and shorter delays until you find the smallest one that will work, or you can use something like a Wait 

    https://support.smartbear.com/testcomplete/docs/app-objects/common-tasks/waiting-process-or-window-activation.html