Hi,
How can ranorex detect error icon coming from web application and stops test case. If I am running 3 test cases back to back and in second test case, error icon came in status bar for some reason. I want to stop test case and log valid error message in Report.Log(......).
How to detect error icon coming from web application.
-
- Posts: 11
- Joined: Mon Jan 14, 2013 8:50 pm
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: How to detect error icon coming from web application.
Hello,
Could you please post a 'Ranorex Snapshot' of your application when this error icon is shown?
Please take a look at section Creating Ranorex Snapshot Files in our User Guide.
Regards,
Markus (T)
Could you please post a 'Ranorex Snapshot' of your application when this error icon is shown?
Please take a look at section Creating Ranorex Snapshot Files in our User Guide.
Regards,
Markus (T)
-
- Posts: 11
- Joined: Mon Jan 14, 2013 8:50 pm
Re: How to detect error icon coming from web application.
Please find attached ranorex snapshot.
You do not have the required permissions to view the files attached to this post.
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: How to detect error icon coming from web application.
Hello,
It is a bit tricky to implement your desired behavior.
Please follow these steps:
1) You need a bool field and a PopupWatcher in your UserCode:
Regards,
Markus (T)
It is a bit tricky to implement your desired behavior.
Please follow these steps:
1) You need a bool field and a PopupWatcher in your UserCode:
private static bool abortTest = false; private static PopupWatcher myPopupWatcher = new PopupWatcher(); private void Init() { string yourItem = "/form[@title~'^Risk\ Policy\ Manager\ -\ Win']/element[@class='Frame Tab']//listitem[@text='Done']"; myPopupWatcher.Watch(yourItem, WarningIsShown); myPopupWatcher.Start(); }2) You need to create a method for the PopupWatcher:
public static void WarningIsShown(Ranorex.Core.RxPath myPath, Ranorex.Core.Element myElement) { Report.Info("Warning is shown!"); abortTest = true; myPopupWatcher.Stop(); }3) You need to add a UserCode method in your recording (last action e.g.):
public void endTest() { if (abortTest) { throw new Exception("Test was aborted because of a popup."); } }Please try out these steps.
Regards,
Markus (T)
-
- Posts: 11
- Joined: Mon Jan 14, 2013 8:50 pm
Re: How to detect error icon coming from web application.
It worked.
Thanks,
Swapnil
Thanks,
Swapnil
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: How to detect error icon coming from web application.
Hello,
Thanks for your feedback
Regards,
Markus (T)(
Thanks for your feedback
Regards,
Markus (T)(