How to check if a cell must be not editable

Class library usage, coding and language questions.
testeur
Posts: 11
Joined: Fri Aug 10, 2012 10:38 am

How to check if a cell must be not editable

Post by testeur » Fri Aug 10, 2012 12:49 pm

Hello,

I am working with silverlight 5 grid, IE9, Windows 7 enteprise, Ranorex 3.3.1
i would like to know if there is a way to check that a cell is not editable.

I try to identify elements but no value '', 'null' is possible to tick in Ranorex properties.

I try to click the cell, type keyboard numbers and record image.
But the colors of images saved by Ranorex ( RGB:250,184,161 )
is little different from web site ( RGB 249,210,85 ).

Is there other ways to check that a cell is not editable ?

Thanks for your answers.

Best Regards,
Thierry

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: How to check if a cell must be not editable

Post by Support Team » Fri Aug 10, 2012 2:05 pm

Hello,

In order to analyze the issue we would need a Ranorex Snapshot file of at least a cell of your application which is editable and one of a cell which isn't editable.
In general you can use the Ranorex Spy tool to check if there is a specific attribute which shows if a cell is editable or not.
Following link will show you how to generate a snapshot file:
Creating Ranorex Snapshot Files

Regards,
Markus
Ranorex Support Team
.
Image

testeur
Posts: 11
Joined: Fri Aug 10, 2012 10:38 am

Re: How to check if a cell must be not editable

Post by testeur » Fri Aug 10, 2012 2:28 pm

Hello,

i added two files attached.
I use the ranorex spy and select an editable cell an one which is not editable.
I right click on the element and use the "Save as snapshot" menu in the ranorx spy tree.

Hope this is the right thing you need to help you to allow you to investigate.

Best Regards,
Thierry
Attachments
Cell_not_editable.rxsnp
(304.83 KiB) Downloaded 196 times
Cell_editable.rxsnp
(305.1 KiB) Downloaded 181 times

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: How to check if a cell must be not editable

Post by Support Team » Mon Aug 13, 2012 1:11 pm

Hello,

I checked the files and the Visible attribute of the editable cell is false, and the attribute of the cell which is not editable is true, could it be that you mixed up the names of the two snapshots?
Are all editable cells shown as invisible?
If yes, you could use this attribute to check if the cell is editable or not.

Regards,
Markus
Ranorex Support Team
.
Image

testeur
Posts: 11
Joined: Fri Aug 10, 2012 10:38 am

Re: How to check if a cell must be not editable

Post by testeur » Mon Aug 13, 2012 5:09 pm

Hello Markus,

I double check again for the names of the files and something has changed.
The attribute is set to "true" in the two cases ( cell editable or not ).
I attached the new files.

So, i am not sure that the "visible" attribute is made to check
if a cell is editable or not.

Maybe the solution, Ranorex can display more elements
from Silverlight Datagrid in the ranorex Spy to identify the good one ?

Best Regards,
Thierry
Attachments
Cell_not_editable2.rxsnp
(298.3 KiB) Downloaded 185 times
Cell_editable2.rxsnp
(298.31 KiB) Downloaded 190 times

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: How to check if a cell must be not editable

Post by Support Team » Tue Aug 14, 2012 12:21 pm

Hello Thierry,

The visible attribute is normally not the right attribute to check if it is editable or not, but I thought if that attribute is the only difference you can try to use this one to get the actual state.

What do you mean with "Ranorex can display more elements
from Silverlight Datagrid in the ranorex Spy to identify the good one"?
Just a question is the 'Windowless' property of the Silverlight HTML object set to false?

It seems that there is unfortunately no such property which shows if the cell is editable or not.
Maybe it is a valid workaround for you if you check if the text of such cell changed after you have edited it.

Regards,
Markus
Ranorex Support Team
.
Image

testeur
Posts: 11
Joined: Fri Aug 10, 2012 10:38 am

Re: How to check if a cell must be not editable

Post by testeur » Tue Aug 14, 2012 3:41 pm

Hello,

i found for the good attribute or cells : "isenabled" ==> http://msdn.microsoft.com/en-us/library ... s.95).aspx
And for some others elements : isReadOnly ==> http://msdn.microsoft.com/en-us/library ... s.95).aspx
An idea is to make those attribute appear in ranorex spy for next releases
in order to tick it for validation ?

At this time, i will use those workarounds :
1) When the cell is editable, we can use the workaround to type text and
check text has changed ==> OK
2) When the cell is not editable and not empty at the beginning,
we can use the workaround to type text and check text hasn't change ==> OK
3) But, there is another case when the cell is not editable and empty at the beginning,
I click on it, type "1" and would like to check, that cells is still empty.
But There is no attribute name to check to be null or empty.

Sorry, I don't understand about windowsless property, i don't see in the snapshots.

Best Regards,
Thierry
Attachments
Silverlight_grid.png
Silverlight_grid.png (17.89 KiB) Viewed 1609 times

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: How to check if a cell must be not editable

Post by Support Team » Thu Aug 16, 2012 1:14 pm

Hi,

Add 3: This should work, you can for instance use this code or the following RxPath:
/dom[@caption='IPVPN OSM']/...text[@text=null()]
OR:
Validate.Attribute(repo.YourElement, "Text", null);
Ranorex uses the UIA “Microsoft UIAutomation framework” to identify such controls
and if the implementation of UIA for these controls does not provide the appropriate information Ranorex is also not able to show it.
Normally the UIA Provider should provide such an information, if it wasn't created properly you can try to fix it or to set a UIA property to make the information accessible for Ranorex.

Regards,
Markus
Ranorex Support Team
.
Image

testeur
Posts: 11
Joined: Fri Aug 10, 2012 10:38 am

Re: How to check if a cell must be not editable

Post by testeur » Mon Aug 20, 2012 10:00 am

Hello Markus,

thank you very much for your examples !
That's work perfectly now for all cases.

Best Regards,
Thierry

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: How to check if a cell must be not editable

Post by Support Team » Mon Aug 20, 2012 12:51 pm

I am glad I was able to help :).

Regards,
Markus
Ranorex Support Team
.
Image