Forum Discussion

MarcusBengtsson's avatar
MarcusBengtsson
Frequent Contributor
2 years ago

If object exist execute, if not continue

Hello! I am probably overthinking it but I am sure this has worked before so it confuses me now.

 

I am trying to execute a keyword test IF the object exist. If it does not exist it should continue with the else. Is this the wrong way to use it?

  • Hmm strange, I had a broken If Object before aswell, I replaced it with a new one that does exactly the same and it worked, You could try this maybe.

    Otherwise someone else might have a fix or Smart-bear support can help.

  • MW_Didata's avatar
    MW_Didata
    Regular Contributor

    Hmm strange, I had a broken If Object before aswell, I replaced it with a new one that does exactly the same and it worked, You could try this maybe.

    Otherwise someone else might have a fix or Smart-bear support can help.

    • MarcusBengtsson's avatar
      MarcusBengtsson
      Frequent Contributor

      Yep re-creating the if object seemed to solved it somehow. Strange how that occures, thank you!

  • rraghvani's avatar
    rraghvani
    Champion Level 3

    Might be worth raising a ticket for this, as you don't want to be re-creating the steps if you have hundreds to update. It could be a genuine bug.

  • MW_Didata's avatar
    MW_Didata
    Regular Contributor

    Does it not work now? What does the log say?

     

    To me it looks like this should work, maybe the object exists but is not visible?

    • MarcusBengtsson's avatar
      MarcusBengtsson
      Frequent Contributor

      I know right but it gives no error message that is understandable. (image)

       

      The error occures at the first if object.

  • rraghvani's avatar
    rraghvani
    Champion Level 3

    Use the Object Spy tool, verify the Exists property of Aliases.ComTestRibbonMenu.HwndS...

     

    What is it showing?