Using PopupWatcher

Ask general questions here.
Eamonn
Posts: 59
Joined: Wed Jul 16, 2014 9:30 am
Location: Dundalk, Ireland.

Using PopupWatcher

Post by Eamonn » Wed Dec 09, 2015 6:11 pm

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 [email protected] 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?

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 3921
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: Using PopupWatcher

Post by odklizec » Thu Dec 10, 2015 8:52 am

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;
Pavel Kudrys
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

Eamonn
Posts: 59
Joined: Wed Jul 16, 2014 9:30 am
Location: Dundalk, Ireland.

Re: Using PopupWatcher

Post by Eamonn » Thu Dec 10, 2015 12:48 pm

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?

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 3921
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: Using PopupWatcher

Post by odklizec » Thu Dec 10, 2015 1:10 pm

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;
Pavel Kudrys
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

Eamonn
Posts: 59
Joined: Wed Jul 16, 2014 9:30 am
Location: Dundalk, Ireland.

Re: Using PopupWatcher

Post by Eamonn » Thu Dec 10, 2015 2:38 pm

Before I got your reply I had placed it in the position you're suggesting and it worked perfectly.
Thanks for all your help

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 3921
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: Using PopupWatcher

Post by odklizec » Thu Dec 10, 2015 3:23 pm

You are welcome! ;)
Pavel Kudrys
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