Forum Discussion

Guigz's avatar
Guigz
Occasional Contributor
28 days ago
Solved

Simple test looking for a TextNode end up not finding it even if it is in the screenshot.

Hi, I made a KeywordTest that open a CHM file and search for a TextNode found in the right section and this test fail intermittently because it does not find the text, but the screenshot shows me that everything looks fine.

The Mapped object only have 2 properties, the ObjectType which is the TextNode and the contentText with the expected text with a wildcard (blabla.* to only search for the begining). The screen shot shows me the TextNode and it seem to respect the contentText, so I don't know what is going on. Am I missing something? 

Thanks!

  • If a problem is intermittent, I usually start looking for a timing issue. To prove this out, you can put a long Delay between the open and the search and let's see if that cuts down the failures significantly. If that is indeed the problem, then we can work on a better way to handle the timing. Delay is easy to do but there are more elegant ways to implement it.

    If that doesn't make the problem better, we'll try something else.

  • If a problem is intermittent, I usually start looking for a timing issue. To prove this out, you can put a long Delay between the open and the search and let's see if that cuts down the failures significantly. If that is indeed the problem, then we can work on a better way to handle the timing. Delay is easy to do but there are more elegant ways to implement it.

    If that doesn't make the problem better, we'll try something else.

    • Guigz's avatar
      Guigz
      Occasional Contributor

      I'll try that, thanks!

  • Hassan_Ballan's avatar
    Hassan_Ballan
    Regular Contributor

    When it fails, what are the log Details "Expected value" and "Actual value"?

    • Guigz's avatar
      Guigz
      Occasional Contributor

      Unable to verify a value with the property checkpoint, because the target object does not exist. It then say that the parent object was not found. Maybe it's as rraghvani say and the .chm window is not fully exposed to TC since the screenshot show me that it shound be found.

      • Hassan_Ballan's avatar
        Hassan_Ballan
        Regular Contributor

        In that case you need to wait for the parent object and for the object itself to be ready. Adding a hard wait may not be enough and unnecessarily will slow down.

        You can add a check for object exist, enabled, and visibleonscreen.

  • rraghvani's avatar
    rraghvani
    Champion Level 3

    As Marsha_R has mentioned, it's most likely relating to timing issues.

    You've programmed to perform a content check against the .chm file, and most likely the .chm window has not been fully exposed to TC yet. So inserting a delay after opening the .chm, may solve the issue for you.

    Without seeing the code, we can only assume this is the possible cause.