What is the correct format for WaitWPFObject in Python?
Here is the name mapping when I use the object spy
I am running the application and getting the process with
process <SPAN class="token operator">=</SPAN> TestedApps<SPAN class="token punctuation">.</SPAN>Virtek_Applications_ServerManager<SPAN class="token punctuation">.</SPAN>Run<SPAN class="token punctuation">(</SPAN>count<SPAN class="token punctuation">,</SPAN> ignore_running<SPAN class="token punctuation">,</SPAN> timeout_ms<SPAN class="token punctuation">)</SPAN>
and attempting to make sure it exists via
o <SPAN class="token operator">=</SPAN> process<SPAN class="token punctuation">.</SPAN>WaitWPFObject<SPAN class="token punctuation">(</SPAN><SPAN class="token string">'WPFObject("HwndSource: ShellView", "Virtek Iris")'</SPAN><SPAN class="token punctuation">,</SPAN> timeout_ms<SPAN class="token punctuation">)</SPAN>
However
o<SPAN class="token punctuation">.</SPAN>Exists
is returning False even though the application is definitely open.
Here are the docs I have been using for reference,
https://support.smartbear.com/testcomplete/docs/reference/project-objects/items/tested-apps/testedapp/run.html
However, the WaitWPFObject doc doesn't actually have a code snippet example to follow.
This was SUPER helpful. Thank you very much!!
Here is what I learned after using this example.
1. Basically, whatever arguments you can get to work for the WPFObject Method, you need to use the exact same arguments for the WaitWPFObject Method.2. I had misread the API and thought the WndCaption was optional. So I passed the ClassName, but left off the WndCaption so the function overloaded to assume I was passing in the Name.
So when I was using
p = Sys.Process("VirtekIrisClient")
o = p.WaitWPFObject("HwndSource: ShellView",timeout_ms)
It wouldn't work. When I used
p = Sys.Process("VirtekIrisClient")
o = p.WaitWPFObject("HwndSource: ShellView","Virtek Iris",timeout_ms)
It worked.