PopUpWatcher Issues

Technology specific object identification, supported applications, web technologies, and 3rd party controls.
wcrockett
Posts: 17
Joined: Thu Aug 13, 2015 9:30 pm
Location: Fresno, CA

PopUpWatcher Issues

Post by wcrockett » Fri Jan 15, 2016 4:56 pm

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.
Attachments
testimage.PNG
report image
testimage.PNG (76.6 KiB) Viewed 751 times

wcrockett
Posts: 17
Joined: Thu Aug 13, 2015 9:30 pm
Location: Fresno, CA

Re: PopUpWatcher Issues

Post by wcrockett » Fri Jan 15, 2016 7:58 pm

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.

krstcs
Ranorex Guru
Posts: 2683
Joined: Tue Feb 07, 2012 4:14 pm
Location: Austin, Texas, USA

Re: PopUpWatcher Issues

Post by krstcs » Fri Jan 15, 2016 8:09 pm

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.
Shortcuts usually aren't...