Page 1 of 1

Using PopupWatcher

Posted: Wed Dec 09, 2015 6:11 pm
by Eamonn
I have added the PopupWatcher code to the Program.cs. It appear to be finding the popup and does clear it. However, when I examined the Ranorex report the ' Info - Popup Watcher - Found popup dialog ' and the 'Info - Popup Watcher - Click on item' is repeated three times to clear the popup.

try
{
//use PopupWatcher catch 'Please Take Our Survey@ popup
//Popup is named 'Medallia_panel'

PopupWatcher myPopupWatcher = new PopupWatcher();

// Add a Watch using the repository folder object and the info object of the button to click
myPopupWatcher.WatchAndClick(ShopHomeSmartRegression.ShopHomeSmartRegressionRepository.Instance.
HOMESMARTRentToOwnFurnitureElectr1.MEDALLIAMaskInfo, ShopHomeSmartRegression.
ShopHomeSmartRegressionRepository.Instance.
HOMESMARTRentToOwnFurnitureElectr1.MEDALLIAPanelInner1.NoThankYouInfo);

//Start PopupWatch
myPopupWatcher.Start();
error = TestSuiteRunner.Run(typeof(Program), Environment.CommandLine);

//end myPopupWatcher
myPopupWatcher.Stop();

}//try end

Can you suggest how I might stop the Watch and Close repeat three times?

Re: Using PopupWatcher

Posted: Thu Dec 10, 2015 8:52 am
by odklizec
Hi,

I'm afraid, there is too little information in your post so all we can do are just some guesses. What's your Ranorex version (latest is 5.4.4)? Could you please post entire report so we can evaluate the problem?

My best guess is that the element you are watching is either not closed immediately after the first click, therefore popupwatcher catches it on its next iteration? Another possibility is, that the watched element simply reappears after the first click?

Anyway, what you can try is to change the popupwatcher interval, after which he checks the existence of watched element. Default interval value is 100ms. So maybe you should try something like 500ms. You can set the interval using code like this:

Code: Select all

yourpopupwatcher.UpdateInterval = 500;

Re: Using PopupWatcher

Posted: Thu Dec 10, 2015 12:48 pm
by Eamonn
Thank you very much odklizec for your reply.
The version of Ranorex I am using is 5.4.1.25490
I am unable to share the Ranorex report as it contains client detail.

I wish to try your suggestion, please advise where to place your suggested piece of code?

Re: Using PopupWatcher

Posted: Thu Dec 10, 2015 1:10 pm
by odklizec
Hi,

I think it's safe to place this piece of code right after the popupwatcher definition...

Code: Select all

PopupWatcher myPopupWatcher = new PopupWatcher(); 
myPopupWatcher.UpdateInterval = 500;

Re: Using PopupWatcher

Posted: Thu Dec 10, 2015 2:38 pm
by Eamonn
Before I got your reply I had placed it in the position you're suggesting and it worked perfectly.
Thanks for all your help

Re: Using PopupWatcher

Posted: Thu Dec 10, 2015 3:23 pm
by odklizec
You are welcome! ;)