GetAttributeValue varies behavior across the browsers
Posted: Mon Mar 16, 2015 2:28 pm
Hi,
Firstly let me just state that we do not use the ranorex repo. I mainly just create WebElements as needed and use them from C# code.
Also I am using Ranorex 5.3.0.22324
I have 2 questions to ask really:
1. I have noticed the getAttributeValue<T>(string) function on Adapter (and things that inherit from Adapter) is protected. Is there a particular reason you haven't implemented the ability to query attributes from the adapter and have to use the adapter.element.GetAttributeValue() function? Just seems to be the only place I have ever had to use the adapter.element property.
2. This is the actual issue here. WebElement.Element.GetAttributeValue() appears to work for any attributes of an element which are visible in ranorex spy (for instance "Class" or "Id"). However if i use the statement WebElement.Element.GetAttributeValue("clientWidth"); The correct value is returned when using IE but in Firefox and Chrome, null is returned. This appears to be true for most of the values I have tried.
Is this a ranorex bug? limitation? or is the fact that it works in IE just plain luck?
Also is there a workaround to get these values?
Thanks in advance,
Mike
Firstly let me just state that we do not use the ranorex repo. I mainly just create WebElements as needed and use them from C# code.
Also I am using Ranorex 5.3.0.22324
I have 2 questions to ask really:
1. I have noticed the getAttributeValue<T>(string) function on Adapter (and things that inherit from Adapter) is protected. Is there a particular reason you haven't implemented the ability to query attributes from the adapter and have to use the adapter.element.GetAttributeValue() function? Just seems to be the only place I have ever had to use the adapter.element property.
2. This is the actual issue here. WebElement.Element.GetAttributeValue() appears to work for any attributes of an element which are visible in ranorex spy (for instance "Class" or "Id"). However if i use the statement WebElement.Element.GetAttributeValue("clientWidth"); The correct value is returned when using IE but in Firefox and Chrome, null is returned. This appears to be true for most of the values I have tried.
Is this a ranorex bug? limitation? or is the fact that it works in IE just plain luck?
Also is there a workaround to get these values?
Thanks in advance,
Mike