Go to next step or teadrown
Go to next step or teadrown
Hi, I have a question, I have a code that is waiting for the printout, the time is set to 10h but in the course of a pop-up error popupwatcher will detect it and close but how to make the code to finish the step and go to the next or to the teardown?
Re: Go to next step or teadrown
Hi, sadly this is not yet possible from popupwatcher. At least not directly.
Pavel Kudrys
Ranorex explorer at Descartes Systems
Please add these details to your questions:
Ranorex explorer at Descartes Systems
Please add these details to your questions:
- Ranorex Snapshot. Learn how to create one >here<
- Ranorex xPath of problematic element(s)
- Ranorex version
- OS version
- HW configuration
Re: Go to next step or teadrown
Sry but I have no idea how to do it I understand that the level popuupwatcher i will not jump to the next step ;/
Re: Go to next step or teadrown
Well, I'm afraid that without seeing your AUT and test solution, there is not much anyone here can do or suggest? Could you please share the AUT or at least some kind of "hello world" app, simulating your problem?
Pavel Kudrys
Ranorex explorer at Descartes Systems
Please add these details to your questions:
Ranorex explorer at Descartes Systems
Please add these details to your questions:
- Ranorex Snapshot. Learn how to create one >here<
- Ranorex xPath of problematic element(s)
- Ranorex version
- OS version
- HW configuration
Re: Go to next step or teadrown
I have this method
the method turns on at the end of the TC and waits until the print preview window appears
When the error pops up, the popupwatcher closes it, but the method is waiting 10h, and all the rest of tc is blocked
I need to stop this code and go to next or teardown when error pops up
Code: Select all
[UserCodeMethod]
public static void CzekajNaWydruk()
{
repo.FrmMain.PodglądWydrukuInfo.WaitForExists(36000000);
}
When the error pops up, the popupwatcher closes it, but the method is waiting 10h, and all the rest of tc is blocked
I need to stop this code and go to next or teardown when error pops up
Re: Go to next step or teadrown
Yes, I understand. But as mentioned, this is not possible. Not with current popoup watcher implementation, which runs in a separated thread.
At first, why do you need to wait 10h? I think this alone is ridiculous timeout value. You should probably rethink your test case?
There is a way to kill the test from popup watcher, but it will not set the test a failed (described here).
At first, why do you need to wait 10h? I think this alone is ridiculous timeout value. You should probably rethink your test case?
There is a way to kill the test from popup watcher, but it will not set the test a failed (described here).
Pavel Kudrys
Ranorex explorer at Descartes Systems
Please add these details to your questions:
Ranorex explorer at Descartes Systems
Please add these details to your questions:
- Ranorex Snapshot. Learn how to create one >here<
- Ranorex xPath of problematic element(s)
- Ranorex version
- OS version
- HW configuration
Re: Go to next step or teadrown
In the program we have 1000 prints, one generates 10s, one generates 5h and more, the only one that is previewed is a grid with preview or a window with the status of generation that does not appear in every printout, so only the grid with preview remains.
You do not have the required permissions to view the files attached to this post.
Re: Go to next step or teadrown
Hello yaro2o,
The WaitForExist is a timeout that will continue as soon as the element "repo.FrmMain.PodglądWydrukuInfo" appears. The popup watcher that is running on another threat in parallel will click away the error messages.
I assume that "repo.FrmMain.PodglądWydrukuInfo" is the print preview? In this case, the code of the test will continue only after the element appears. If it does not appear and error messages have already been handled by the popup watcher, then this step will actually take 10 hours to fail This is bad... Because, you wait 10 hours for nothing.
If I understand you correctly, then there are only two options (print preview or error). If this is the case, you should not use the popup watcher at all.
You could build a code method for that. You can make it a loop that checks every few seconds if the error has been displayed or if the print preview has been displayed. And you should also limit the loop somehow.
An example could look like this:
Regards,
McTurtle
The WaitForExist is a timeout that will continue as soon as the element "repo.FrmMain.PodglądWydrukuInfo" appears. The popup watcher that is running on another threat in parallel will click away the error messages.
I assume that "repo.FrmMain.PodglądWydrukuInfo" is the print preview? In this case, the code of the test will continue only after the element appears. If it does not appear and error messages have already been handled by the popup watcher, then this step will actually take 10 hours to fail This is bad... Because, you wait 10 hours for nothing.
If I understand you correctly, then there are only two options (print preview or error). If this is the case, you should not use the popup watcher at all.
You could build a code method for that. You can make it a loop that checks every few seconds if the error has been displayed or if the print preview has been displayed. And you should also limit the loop somehow.
An example could look like this:
public void CheckForPopupOrPrintPreview(int NrOfIterations, int SingleSearchTimeoutInMs) { RepoItemInfo printPreviewInfo = repo.YourApplication.PrintPreviewInfo; RepoItemInfo errorMessageInfo = repo.YourApplication.ErrorMessageInfo; int i=0; do { Report.Info(String.Format("Search iteration nr.: {0} for element {1} Waiting for {2} ms.",(i+1).ToString(),printPreviewInfo.Name,SingleSearchTimeoutInMs.ToString())); if (printPreviewInfo.Exists(Duration.FromMilliseconds(SingleSearchTimeoutInMs))==true) { printPreviewInfo.FindAdapter<Ranorex.Button>().Click(); Report.Success("Print preview has been displayed."); break; } Report.Info(String.Format("Search iteration nr.: {0} for element {1} Waiting for {2} ms.",(i+1).ToString(),printPreviewInfo.Name,SingleSearchTimeoutInMs.ToString())); if (errorMessageInfo.Exists(Duration.FromMilliseconds(SingleSearchTimeoutInMs))==true) { errorMessageInfo.FindAdapter<Ranorex.Button>().Click(); Report.Failure("Error popup has been displayed."); break; } i++; } while (i<NrOfIterations); if(i==NrOfIterations) { Report.Failure("No error popup or print preview has been displayed within the given timeframe."); } }Is this helpful?
Regards,
McTurtle