Page 1 of 1

PopUpWatcher Issues

Posted: Fri Jan 15, 2016 4:56 pm
by wcrockett
Hello all,

I have a major issue with the Ranorex PopUpWatcher class. It seems that a pop up with identical appearance and identical button, text, and title have different accessible attributes. On one page, it works fine using @title="..." in the xPath. In the other, I must use @AccessibleName="...". When I use @AccessibleName, though, the one that works with @title totally breaks. This prevents me from just making two watchers.

Once it closes the popup, the mouse interaction clicks off screen several times and never gets back on track with the test. It is somewhat difficult to describe as it is quite obscure. I have attached an image of what the report records. Even though the popup is closed successfully, it keeps detecting as if it still exists.

Here is the PopupWatcher code:

Code: Select all

//Create PopUP Handler
			PopupWatcher myPopupWatcher = new PopupWatcher();
			//myPopupWatcher.Watch("/?/?/?/applet[@caption='oracle.forms.engine.Main']//form[@title='Restricted Information']/container[@caption~'^CAUTION:\\ \\ Some\\ member\\ dat']/element/toolbar[1]/button[@text='OK']", CloseRestrictedInformationDialog);
			//myPopupWatcher.Watch("/?/?/?/applet[@caption='oracle.forms.engine.Main']//form[@accessiblename='Restricted Information']/container[@caption~'^CAUTION:\\ \\ Some\\ member\\ dat']/element/toolbar[1]/button[@text='OK']", CloseRestrictedInformationDialog);
			
			//Data Warnings
			myPopupWatcher.Watch("/dom[@domain='epsappstg.centene.com']/?/?/applet[@caption='oracle.forms.engine.Main']//form[@accessiblename='Restricted Information']/container[@caption~'^CAUTION:\\ \\ Some\\ member\\ dat']/element/toolbar[1]/button[@text='OK']",CloseRestrictedInformationDialog);
			//myPopupWatcher.Watch("/dom[@domain='epsappstg.centene.com']/?/?/applet[@caption='oracle.forms.engine.Main']/?/?/container[@type='FormDesktopContainer']/form[1]/container[@caption~'^CAUTION:\\ \\ Some\\ member\\ dat']/element/toolbar[1]/button[@text='OK']",CloseRestrictedInformationDialog);
			
			myPopupWatcher.Start();
        }
        
        public static void CloseRestrictedInformationDialog(Ranorex.Core.Repository.RepoItemInfo myInfo, Ranorex.Core.Element myElement)
        {
        	Thread.Sleep(300);
      		myElement.As<Ranorex.Button>().Click();
        }
        
        public static void CloseRestrictedInformationDialog(Ranorex.Core.RxPath myPath, Ranorex.Core.Element myElement)  
        {
        	Thread.Sleep(300);
		 	myElement.As<Ranorex.Button>().Click();
		} 
I tried to upload a snapshot but it was too large to attach.

Re: PopUpWatcher Issues

Posted: Fri Jan 15, 2016 7:58 pm
by wcrockett
OK. I figured out a work around. I ended up adding the two (seemingly the same) warning message to my repository and I reference the repo items rather than explicitly having the xpath in the user code. Seems to be working now.

Re: PopUpWatcher Issues

Posted: Fri Jan 15, 2016 8:09 pm
by krstcs
This was going to be my suggestion, before you figured it out. :D

You should always try to use the repository instead of hard-coding paths into your tests as this will allow you the most flexibility and keep you from having as many problems when paths change. That is part of the point of the repository anyway, to keep your paths in a single place and allow easy management.