Invalid variant operation
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Invalid variant operation
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
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
Any views or opinions expressed do not necessarily represent those of SmartBear Software.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
Any views or opinions expressed do not necessarily represent those of SmartBear Software.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
Robert Martin
[Hall of Fame]
Please consider giving a Kudo if I write good stuff
----
Why automate? I do automated testing because there's only so much a human being can do and remain healthy. Sleep is a requirement. So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.
Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you Robert!
My issue is that I have to wait for an object to be loaded on the page, then I want to do some actions on the controls available on that object. If I use the waitProperty on the parent object, and the script would just throw an error saying that it doesn't exist.
what do I do to wait for something to appear on the Web page? I don't want to use Delay() or Page.Wait() in this case.
Thank you
Abhishek
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
In KDT functionality, this is what the "if object" operation can be used for... to check for an object to exist within a particular time range. Use the "if object" operation on your object to detect "Exists" not equal to true. Then right click on the operation and set the Auto-Wait timeout to the maximum time you want to wait. Then, add code that will execute when it comes back false to throw an error or something.
The effect of this is that the test will wait up to that maximum time for the object to Exist. If it doesn't within that time, you'll log an error. If it does, your test will proceed.
If, however, you are using Script code, I'd suggest using the methodology of WaitNNN methods (https://support.smartbear.com/testcomplete/docs/app-objects/common-tasks/waiting-process-or-window-a...).
Robert Martin
[Hall of Fame]
Please consider giving a Kudo if I write good stuff
----
Why automate? I do automated testing because there's only so much a human being can do and remain healthy. Sleep is a requirement. So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.
Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available
