Waiting for WPF Objects without WaitWPFObject
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-12-2010
06:15 AM
03-12-2010
06:15 AM
Waiting for WPF Objects without WaitWPFObject
In the project that I'm testing, I need to wait for a WPF object that may not be available for several minutes as the system does its processing. If I use WaitWPFObject and set the timeout to more than about 30000 milliseconds, it will not wait the whole time.
The semi-solution that I have come accross is to put the WaitWPFObject call in a DO loop and check for it to exist and be visible on screen. The only problem with this is that if the WPF object doesn't exist, it will write an error to the log, which I don't want.
Is there any way to reference a WPF Object from WaitChild or Wait Window, or cause WaitWPFObject not to write an error to the log?
The semi-solution that I have come accross is to put the WaitWPFObject call in a DO loop and check for it to exist and be visible on screen. The only problem with this is that if the WPF object doesn't exist, it will write an error to the log, which I don't want.
Is there any way to reference a WPF Object from WaitChild or Wait Window, or cause WaitWPFObject not to write an error to the log?
6 REPLIES 6
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-16-2010
02:14 PM
03-16-2010
02:14 PM
Oh..God.. this is exactly Im looking for. Please post the solution if you found a workaround.
Thanks..
Thanks..
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-16-2010
09:32 PM
03-16-2010
09:32 PM
Hi Brent,
Wait...() functions should not post errors to the log if the object was not found as this is what they were designed for: try to get the reference to the object that may not exist.
Can you post here the code snippet that posts an error to the log?
Wait...() functions should not post errors to the log if the object was not found as this is what they were designed for: try to get the reference to the object that may not exist.
Can you post here the code snippet that posts an error to the log?
Regards,
/Alex [Community Champion]
____
[Community Champions] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Champions]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Champion] signature is assigned on quarterly basis and is used with permission by SmartBear Software.
https://community.smartbear.com/t5/Community-Champions/About-the-Community-Champions-Program/gpm-p/252662
================================
/Alex [Community Champion]
____
[Community Champions] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Champions]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Champion] signature is assigned on quarterly basis and is used with permission by SmartBear Software.
https://community.smartbear.com/t5/Community-Champions/About-the-Community-Champions-Program/gpm-p/252662
================================
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-17-2010
04:09 AM
03-17-2010
04:09 AM
Hi Alexi,
If I run the following code and it times out, it writes object not found errors to the logs. The screen that I'm waiting for takes a variable amount of time to pop up, depending on the system, so it's something that I need to loop a wait object for.
i = 0
Do
Set w = setup.WPFObject("HwndSource: win_SubscriptionInfo", "Setup").WPFObject("win_SubscriptionInfo", "Setup", 1).WaitWPFObject("DocumentRoot", 45000)
i = i + 1
Loop Until (w.Exists And w.VisibleOnScreen) Or (i > 10)
Set grid = setup.WPFObject("HwndSource: win_SubscriptionInfo", "Setup").WPFObject("win_SubscriptionInfo", "Setup", 1).WPFObject("DocumentRoot")
If I run the following code and it times out, it writes object not found errors to the logs. The screen that I'm waiting for takes a variable amount of time to pop up, depending on the system, so it's something that I need to loop a wait object for.
i = 0
Do
Set w = setup.WPFObject("HwndSource: win_SubscriptionInfo", "Setup").WPFObject("win_SubscriptionInfo", "Setup", 1).WaitWPFObject("DocumentRoot", 45000)
i = i + 1
Loop Until (w.Exists And w.VisibleOnScreen) Or (i > 10)
Set grid = setup.WPFObject("HwndSource: win_SubscriptionInfo", "Setup").WPFObject("win_SubscriptionInfo", "Setup", 1).WPFObject("DocumentRoot")
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-18-2010
12:11 AM
03-18-2010
12:11 AM
Hi Brent,
The error seems to come from the line which follows the loop. You need to remove this line as you already have the target object at this point, and there's no need to obtain it again. Just check 'w.Exists' after your loop and use 'w' if it's True.
The error seems to come from the line which follows the loop. You need to remove this line as you already have the target object at this point, and there's no need to obtain it again. Just check 'w.Exists' after your loop and use 'w' if it's True.
------
Yuri
TestComplete Customer Care Engineer
Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
Yuri
TestComplete Customer Care Engineer
Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-26-2010
07:10 AM
03-26-2010
07:10 AM
I have the same problem with waitChild in a Java App. It does not always wait. Looking at what is inside waitChild, it is just a loop checking for child and then waiting. My suspicion is that wait drops through because it has in fact found the window (perhaps its not completely populated) but then other objects on that window are not yet found.
Strange thing is that sometimes, when I run the application once outside of test complete, it will then respond properly inside a playback script.
-p
Strange thing is that sometimes, when I run the application once outside of test complete, it will then respond properly inside a playback script.
-p
Peter A.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-29-2010
12:39 AM
03-29-2010
12:39 AM
Hi,
You need to use methods specific to Java applications (WaitSwingObject, WaitSWTObject, etc.), not WaitChild. If you are using Name Mapping, obtain your object with WaitAliasChild.
You need to use methods specific to Java applications (WaitSwingObject, WaitSWTObject, etc.), not WaitChild. If you are using Name Mapping, obtain your object with WaitAliasChild.
------
Yuri
TestComplete Customer Care Engineer
Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
Yuri
TestComplete Customer Care Engineer
Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
