New version does not support pop up watcher

Ask general questions here.
Shakib
Posts: 31
Joined: Tue Jan 06, 2015 7:22 am

New version does not support pop up watcher

Post by Shakib » Mon Mar 06, 2017 7:26 am

Hi,
I have installed a new version(6.2.1) which is giving error on my existing code :

'PETNet.Olympus.Automation.UnexpectedPopups': cannot derive from sealed type 'Ranorex.PopupWatcher' (CS0509) - D:\automation\PETNet.Olympus.Automation\UnexpectedPopups.cs:15,15"

I was using pop up watcher class for handling unwanted exceptions, but in new version this class has been made sealed.

And getting one more problem in
Ranorex.pdf class
var isCompressedReport = a.ReportCompress;
below error is coming for above line:

'Ranorex.Core.Testing.TestSuite' does not contain a definition for 'ReportCompress' and no extension method 'ReportCompress' accepting a first argument of type 'Ranorex.Core.Testing.TestSuite' could be found (are you missing a using directive or an assembly reference?) (CS1061) - D:\automation\PETNet.Olympus.Automation\ReportToPDF.cs:124,31


Please let me know how can i use the pop up watcher class in new version

asdf
Posts: 174
Joined: Mon Mar 21, 2016 3:16 pm

Re: New version does not support pop up watcher

Post by asdf » Mon Mar 06, 2017 3:57 pm

Hi Shabik,

Regarding your pop up watcher issue, may I ask how you created the watcher? I also use a pop up watcher within 6.2.1 and everything works fine.
I created a UserCode module and added the following code snippet to it.
void ITestModule.Run()
{
	Mouse.DefaultMoveTime = 300;
	Keyboard.DefaultKeyPressTime = 100;
	Delay.SpeedFactor = 1.0;
	
	PopupWatcher myPopupWatcher = new PopupWatcher();
	myPopupWatcher.Watch(@"/form[@controlname='YourForm']/button[@controlname='YourButton']", Close);
	myPopupWatcher.Start();
}

public static void Close(Ranorex.Core.RxPath myPath, Ranorex.Core.Element myElement)
{
	myElement.As<Ranorex.Button>().Click();
}
Concerning your second issue, I think it is necessary to reference the "Ranorex.Libs.Util.dll" to your project in order to overcome this problem.

I hope this helps.

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

Re: New version does not support pop up watcher

Post by krstcs » Mon Mar 06, 2017 5:09 pm

You can no longer derive a class from Ranorex's PopupWatcher class, as it has been sealed. You must instantiate directly by creating a new PopupWatcher object.
Shortcuts usually aren't...

Shakib
Posts: 31
Joined: Tue Jan 06, 2015 7:22 am

Re: New version does not support pop up watcher

Post by Shakib » Thu Mar 09, 2017 2:39 pm

Thanks asdf its working for me now.
Thanks krstcs also :)