Hi there,
I'm using Ranorex 5.0.3 on a 64bit Win7 machine with up-to-date Windows Updates. While testing with Internet Explorer 11.0.9600.17107 and Chrome 34.0.1847.137 m.
During the tests I tried to run a TestCase in IE, which I had written in Chrome. Everything was executed without errors, except for a verification on an empty innertext element. I discovered that Ranorex or IE seems to handle innertext a bit different to Chrome.
Have a look at the two Ranorex Spy screenshots, which show the element in question.
Internet Explorer:
Chrome:
As you can see, Spy greys out the IE innertext other than the Chrome innertext. This is causing the running failure and is making my automation work a bit messy.
Note: If I fill in a character or more characters, IE and Chrome do detect them equally correct. The problem just arises when there is no character between the DIV tags.
Thank you for any help!
Greetings from Salzburg.
Chrome interprets innertext other than IE
Chrome interprets innertext other than IE
You do not have the required permissions to view the files attached to this post.
Re: Chrome interprets innertext other than IE
The level of grey denotes the weight that Ranorex has assigned to the attribute for the object identification algorithm. The darker the color, the more likely that Ranorex will use that attribute, if it has a value, to identify the element. An InnerText attribute is typically not going to be used unless absolutely necessary because, depending on the object, it could be changed at runtime, but a user. Ranorex favors attributes that are not likely to change (such as id, class, name, automationid, automationname, etc.).
Both Chrome and IE should have an InnerText attribute (all HTML has an InnerText at all times, even if it is null). Have you checked in your test to see what the value of the attribute is?
Both Chrome and IE should have an InnerText attribute (all HTML has an InnerText at all times, even if it is null). Have you checked in your test to see what the value of the attribute is?
Code: Select all
Report.Debug("USER", "Value of InnerText=" + repo.<your object and parents>.InnerText);
Shortcuts usually aren't...
Re: Chrome interprets innertext other than IE
Hi krstcs,
thanks for your reply! During some attempts to fix the problem for me, I found out, that:
For Chrome, the empty innertext element is a zero symbols long string, while for IE, it is <null>.
I don't know if this difference is caused by Ranorex or by the browsers itself.
A very simple solution
Greetings from Austria
thanks for your reply! During some attempts to fix the problem for me, I found out, that:
For Chrome, the empty innertext element is a zero symbols long string, while for IE, it is <null>.
I don't know if this difference is caused by Ranorex or by the browsers itself.
A very simple solution
Code: Select all
if((repo.<PathToElement>.InnerText == "") || (repo.<PathToElement>.InnerText == null))
Re: Chrome interprets innertext other than IE
Yeah, I don't know if it is Chrome/IE or Ranorex, but I would guess Ranorex. If it is possible, Ranorex should be presenting them all the same way, which I think is the problem here.
Shortcuts usually aren't...