Forum Discussion

nbenitus's avatar
nbenitus
Contributor
12 years ago

Invalid variant operation

Hi,



I am doing a very basic operation, waiting for a button to be visible on screen. Here is my code:



Call installerMainWindow.btnFinish.WaitProperty("VisibleOnScreen", true, Project.Variables.long_timeout)



The long_timeout variable has been set to 10 minutes (600000).



When I run Delay(Project.Variables.long_timeout), it does wait for the full 10 minutes.



However, when I run the line entered earlier, it waits for around 1/10th of the time (around 1 minute), then, if the button is not found by that time, I get a runtime error: Invalid variant Operation.



I have no clues what it's going on. I have used the WaitProperty operation dozens of time in my project without problem.



Thanks in advance.



Benoit

7 Replies

  • Julia_K's avatar
    Julia_K
    SmartBear Alumni (Retired)
    Hello Benoit,

    Could you please specify whether the Invalid Variant Operation error occurs only for some specific objects in your tested application? Does the error occur if you call the WaitProperty method with the hard-coded time-out value?

    Can you reproduce the problem when calling the WaitProperty method for another object or with other parameters?

    Thank you.
  • Thank you Julia for your answer and sorry for the late reply.



    I have tried recently and it seems that everything is fine. It is pretty weird as I have seen many Invalid Variant errors recently.



    May I post a reply to this thread if the problem happens again?



    Thanks again.



    Benoit
  • Julia_K's avatar
    Julia_K
    SmartBear Alumni (Retired)
    Hello Benoit,

    May I post a reply to this thread if the problem happens again?


    Yes, you certainly may.  Please do not hesitate to post to this thread if you face the same problem again.

    Also, feel free to contact us on this forum or via the Contact Support web form if you come across any other problems or questions.

    Thank you and good luck with your testing.
    • Adagio's avatar
      Adagio
      Frequent Contributor

      Hello,

       

      I'm encountering a similar problem, but not able to understand why..can someone please help here?

       

      if (panel3.panelComponentHeader.buttonEdit.WaitProperty("Enabled", false, 15000))
      {
      Log.Message("Edit is enabled");
      }
      else
      {
      Log.Error("XXXXXYYYYYYYYYZZZZZZ");
      Runner.Stop();
      }

       

       

      Thank you

      Abhi

      • tristaanogre's avatar
        tristaanogre
        Esteemed Contributor

        My initial thought... are we certain that the object exists before you attempt the WaitProperty on it?  You can't call a WaitProperty method on an object that does not exist.