Page 1 of 1

Ranorex.Text identified but not clicked

Posted: Wed Nov 06, 2013 7:30 am
by lasombra
I have the following table structure withing a Silverlight application

Code: Select all

Table 'objTable'
+-Row 'ColumnHeadersPresenter'
+-Element 'RowsPreseneter'
  +-Element 'Row1'
     +-Element 'Col1'
        +-Text
     +-Element 'Col2'
        +-Text
  +-Element 'Row2'
     +-Element 'Col1'
        +-Text
     +-Element 'Col2'
        +-Text
I try to set the value for the text field in Row2, Col2 with TryFindSingle on the row (which is identified before) i.e.

Code: Select all

Ranorex.Text cell;
rows[1].TryFindSingle("./element[2]/text", out cell);
cell.TextValue = "test"
This returns "Setting attribute 'text' failed on element '{Text:TextBlock}'. The operation is not supported". Well, I know I have to click on the cell before I can set the value. Unfortunately

Code: Select all

cell.Click()
moves the mouse to the upper left corner of the screen.

On the other hand, If I click the cell manually and then run the above code, the cell value is set properly. So why the cell is not clicked as expected?

Re: Ranorex.Text identified but not clicked

Posted: Thu Nov 07, 2013 2:32 pm
by Support Team
First of all, could you please post a Ranorex snapshot of your application, please? Thank you!

When you track the text element under the "Row 2 Col2" element with Ranorex Spy, are the element rectangles correct then? You can easily verify that by turning on the Element Highlighting.

Another thing you can try is to invoke the actions (setting the text and clicking) on the Col2 element instead of text element. I.e. in your code, just remove the "/text" part of the RanoreXPath used in your code.

Regards,
Alex
Ranorex Team

Re: Ranorex.Text identified but not clicked

Posted: Thu Jan 30, 2014 12:38 pm
by AccidentReport
This sounds very similar to an issue I'm having. Was there a solution?!

Re: Ranorex.Text identified but not clicked

Posted: Fri Jan 31, 2014 10:32 am
by Support Team
Hi AccidentReport,

There is no solution at the moment because we didn't get an answer.
Can you please describe your issue in more detail and answer the questions Alex asked?

Regards,
Bernhard