Page 1 of 1

Chrome objects not identified for cross browser testing

Posted: Fri Apr 08, 2016 5:43 pm
by StarFox
I'm attempting to create a simple automated scripts that works on Firefox, IE, and Chrome. I got objects identified originally in Firefox to work in IE with only a little tweaking. Ex:

/dom[@domain='IP:Port']//section[#'content']/?/?/section//form[@name='loginForm']/div[2]/?/?/?/input[@type='checkbox']

However, the same object on the same page in Chrome gives me:

/form[@title~'^X\ X:\ Disclaimer\ -\ Go']/element[@controlid='-532377376']/container[@accessiblename='X X: Disclaimer']/container/container[@accessiblerole='Grouping']//checkbox[@accessiblerole='CheckButton']

With the Xpath completely different the same object in Chrome isn't seen in the other browsers, and vice versa.

Here's what I'm running on, and what I've done so far to get Chrome objects identified:
Ranorex 5.4.6 (Evaluation)
Ranorex Chrome extension 1.0.10
Chrome version 49.0.2623.112 m (64-bit)
Windows Server 2012 R2 Standard


I turned on global accessibility mode in Chrome.
I added the following flag to my Chrome.exe shortcut:
--disable-web-security --user-data-dir="C:\Users\gssuser\Documents\ChromeTestData"

Am missing something? Can anyone please help me get Chrome objects to be identified like they are in FF and IE?

Re: Chrome objects not identified for cross browser testing

Posted: Mon Apr 11, 2016 10:02 am
by odklizec
Hi,

Apparently, Ranorex is not able to identify the DOM element and instead recognizes your page as a form and bunch of elements/containers? It sounds like a problem with Chrome extension? Are you sure the installed Ranorex extension is 1.0.10? Not just 1.0.1?

The thing is that the actual Ranorex extension (in Chrome store) says 1.0.9. I have 1.0.9 installed in my Chrome and Ranorex recognizes DOM elements as expected.

Re: Chrome objects not identified for cross browser testing

Posted: Mon Apr 11, 2016 4:42 pm
by StarFox
Here's a screenshot of the extension in Chrome.
[img]
RanorexExtension.PNG
[/img]

I had to install it from the latest Ranorex build itself since the server I'm using doesn't have Internet access.

Re: Chrome objects not identified for cross browser testing

Posted: Tue Apr 12, 2016 8:04 am
by odklizec
That's weird. As far as I understand it, Ranorex plugin for Chrome is currently available via Chrome web store and all I can see there is Ranorex 1.0.9...
rx_chrome_1.0.9.png
1.0.10 sounds like a more recent version, so there is most probably no need to downgrade it to 1.0.9. My guess is, that Ranorex folks simply forgot to update the plugin in all regions? ;)

Anyway, I think your problem is related to something else than plugin version. If I'm not mistaken, the issue you are facing is caused by a combination of two problems.
1) Disabled Global Accessibility in Chrome. Please check the following post:
http://www.ranorex.com/forum/ranorex-is ... tml#p27734

Unfortunately, the parameter you are using (--disable-web-security) is not enough to start Chrome browser with Global Accessibility enabled. Just enable the Global Accessibility mode manually, as suggested in the above link. A cmd line parameter to enable global accessibility mode should be --force-renderer-accessibility.

2) As for the second reason, it seems the parameter --user-data-dir somehow breaks the Ranorex capability to detect DOM, even with enabled Global Accessibility? Chrome and Ranorex works fine for me with default user dir, but not with the custom one (even with manually enabled global accessibility). It's probably something to check by Ranorex folks? My guess is that the Ranorex addon simply does not work OK with data dir specified from command line?

Re: Chrome objects not identified for cross browser testing

Posted: Tue Apr 12, 2016 9:34 pm
by StarFox
I was able to install the 1.0.9 extension, but still don't have any luck with DOM elements. I'm not having any issue with DOM elements when I run Ranorex and Chrome on my local machine that runs Windows 7 and has Internet access. Would the fact I'm using Windows Server 2012 R2 possibly be an issue?

[img]
RanorexExtension2.PNG
[/img]

Re: Chrome objects not identified for cross browser testing

Posted: Wed Apr 13, 2016 7:11 am
by odklizec
Hi,

Have you examined the Global Accessibility flag mentioned in my previous post? I think this is the most probable reason why Ranorex does not identify the elements. Also, I would suggest to check this discussion...
http://www.ranorex.com/forum/open-chrom ... t9232.html