Page 1 of 1

OpenBrowser - troubleshoot "instrument = true" not working

Posted: Mon Jun 03, 2019 9:12 pm
by dhale
I'm trying to figure out why some of my VM's are randomly disabling the IE Ranorex plugin - even when I have Instrument option set to true when I launch the browser.

VM's are Win7, running IE 11.0.9600.19326

The first time I noticed this issue a few weeks ago, I manually enabled the plugin on the handful of VM's that had it disabled.
Our VM template has this plugin enabled, and when freshly deployed, its enabled.

Out of 40 VM's, it was only a handful that had it disabled. (I forget the exact count, but it was only like 10 or so of the 40)
I have no clue how to find out what or how this is happening.

Any have any ideas how to figure this one out?
This is how I launch by browser: Ranorex.Host.Local.OpenBrowser(<URL is here>, BrowserName, null, false, true, false, false, false, true);
Which, I figured would overcome whatever it is that is disabling the IE plugin... but no dice.

Re: OpenBrowser - troubleshoot "instrument = true" not working

Posted: Tue Jun 04, 2019 2:57 pm
by qwertzu
HI,

Is the plugin really shown as "disabled" or does it show "incompatible"?
I guess there is nothing from Ranorex-side that would disable the plugin.
You could talk to your IT staff and verify if there are some differences (e.g. group policy) on the machines on which the plugin gets disabled compared to other machines.
Could it also be that other users use these machines and maybe disable the plugin manually for some reason?

By the way, the "instrument = true" just newly adds the extension to the browser.

regards, qwertzu

Re: OpenBrowser - troubleshoot "instrument = true" not working

Posted: Wed Jun 05, 2019 2:16 pm
by dhale
Plugin shows as disabled. Its just weird.
I wish I could find some log of when/who.how this gets changed to Disabled
Whats odd is that all of the VM's are clones of a single template. So why not all of them have the issue is whats really odd.
These are just used by our Bamboo CI server to run our tests on, very seldom does a human other than me ever VNC into one of these VM's, usually only me in cases like this where I'm trying to figure out what happened.

I dont know a ton about group policy, but will ask IT if they have any thoughts on this - its worth a shot

Re: OpenBrowser - troubleshoot "instrument = true" not working

Posted: Wed Jun 05, 2019 5:06 pm
by dhale
IT confirmed no group policy is applied to these VM's

The Ranorex IE plugin registry values are located under
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Ext\Settings\{504839B4-0C9A-4B5B-B00F-DEB2EEB870D7}]
And what I just noticed, is that the Flags entry in the registry is set to 0x00000040 (64) on the machines where the plugin is disabled, which is different than when a human disables it. When a human disables it, its 1, when its enabled its 0x00000400 (1024)

I'm not sure what the 0x00000040 means exactly at the moment. If I can figure this out, i'll probably get my answer.

I tried to set the registry manually in code, but that didnt work on the VM's for some reason.
I'm not a registry expert so I'll have to look further into this

Code: Select all

//            try {
//	            //Ranorex IE plugin - make sure that its enabled 
//	            RegistryKey key = RegistryKey.OpenBaseKey(Microsoft.Win32.RegistryHive.CurrentUser, Environment.Is64BitOperatingSystem ? RegistryView.Registry64 : RegistryView.Registry32);
//	            key.OpenSubKey(@"Software\Microsoft\Windows\CurrentVersion\Ext\Settings\{504839B4-0C9A-4B5B-B00F-DEB2EEB870D7}", true);	
//				if (key != null) {
//	            	key.SetValue("Flags", 1024, RegistryValueKind.DWord); //REG_DWORD 0x00000400	(1024) is enabled, 512 is new, 1 is disabled
//					key.Close();
//				}            	
//            } catch (Exception ex) {
//            	Ranorex.Report.Failure(string.Format("{0}\r\n{1}\r\n{2}", ex.Message, ex.InnerException, ex.StackTrace));
//            }

Re: OpenBrowser - troubleshoot "instrument = true" not working

Posted: Thu Jun 06, 2019 3:56 pm
by dhale
So this is really weird - from what I can tell, either IE or the IE plugin is somehow crashing in the middle of a test for some unknown reason.
I was looking over all of my reports and found one of the VM's reports where many tests had been run just fine, then a little bit after a test started, made it about half way through the test, and then I see this in the Ranorex log file:

Code: Select all

2019-06-05 22:07:54.706| WARN|Ranorex.Plugin.WebFlavor|Failed to get browser from handle 14878872. System.Threading.ThreadAbortException: Thread was being aborted.
   at SHDocVw.IWebBrowser2.get_Document()
   at Ranorex.Plugin.WebDocumentFlavorElement..ctor(IntPtr ieHandle, IWebBrowser2 browser, IHTMLDocument2 browserDocument)
   at Ranorex.Plugin.WebFlavor.TopLevelRule_Create(IntPtr hwnd, FlavorElement& flavorElement)
2019-06-05 22:07:54.708| WARN|Ranorex.Plugin.TopLevelRule|Unexpected exception from toplevel createhandler: System.Threading.ThreadAbortException: Thread was being aborted.
   at Ranorex.Plugin.WebFlavor.TopLevelRule_Create(IntPtr hwnd, FlavorElement& flavorElement)
   at Ranorex.Plugin.TopLevelRule.Execute(GlueRuleExecutionState state)
The last line of code to be executed thatI can tell just before this crash, was checking SelfInfo.Exists() on a repo item.

And then I see this

Code: Select all

2019-06-05 22:07:58.302| WARN|Ranorex.Report|Internet Explorer: Please make sure that you have the Ranorex Addon installed and enabled in Internet Explorer. Otherwise Ranorex UI element identification might be very slow.
Process: 'iexplore' (pid 1452)
The following website provides more information on this technology limitation:
https://www.ranorex.com/help/v9.0/interfaces-connectivity/technology-instrumentation/general-troubleshooting/#Browser
(This message is only shown once per report.)

Re: OpenBrowser - troubleshoot "instrument = true" not working

Posted: Fri Jun 07, 2019 1:26 pm
by Support Team
Hello dhale,

I never saw Ranorex disabling its own addon during runtime. May I ask which version of Ranorex are you currently using? Is it 9.0?
If you are not on the latest version, I would recommend updating Ranorex and check if the issue persists. Can you reproduce the issue with the SelfInfo.Exists() action?
Is there any anti-virus software running? If yes, please disable the anti-virus software and check if that changes the behavior.

Regards,
Bernhard

Re: OpenBrowser - troubleshoot "instrument = true" not working

Posted: Fri Jun 07, 2019 2:19 pm
by dhale
We are currently on 9.0.1, and plan to upgrade to latest after our current testing cycle is complete - so it will be a week or two before upgrade.
There is one change I think I will implement on our VM's, to see if it helps any and that is to add registry key IgnoreFrameApprovalCheck to hopefully skip over the prompting to enable add-on's, as discussed over here:

https://social.technet.microsoft.com/Fo ... currentver