Hi,
I want to recover the row number from a specific value and use that variable in a repository item.
I used this source code with action get value :
IList<Ranorex.Cell> AllCells = repo.Myapp.Form7854852.TableDg.FindDescendants<Ranorex.Cell>();
foreach (Ranorex.Cell ThisCell in AllCells )
{
if (ThisCell.Text == repo.titre)
{
repo.rownumber=ThisCell.RowIndex.ToString();
}
}
Thank you,
Get value of row number from specific value
Re: Get value of row number from specific value
Hi,
Please post a Ranorex snapshot (not screenshot!) of the problematic element. It's hard to suggest something reliable without snapshot or working sample app.
Please post a Ranorex snapshot (not screenshot!) of the problematic element. It's hard to suggest something reliable without snapshot or working sample app.
Pavel Kudrys
Ranorex explorer at Descartes Systems
Please add these details to your questions:
Ranorex explorer at Descartes Systems
Please add these details to your questions:
- Ranorex Snapshot. Learn how to create one >here<
- Ranorex xPath of problematic element(s)
- Ranorex version
- OS version
- HW configuration
Re: Get value of row number from specific value
Hi,
I have attached the snapshot of the problem.
In fact, I have a datagrid and I try to find row number from an expression.
The expression is a variable and i want to use the row number as variable in a repository item.
Thank you,
I have attached the snapshot of the problem.
In fact, I have a datagrid and I try to find row number from an expression.
The expression is a variable and i want to use the row number as variable in a repository item.
Thank you,
You do not have the required permissions to view the files attached to this post.
Re: Get value of row number from specific value
Hi ayat,
Basically, the above-mentioned code seems to be okay. I would suggest debugging the code or adding additional log information.
I assume that the condition is never true and therefore the value is not assigned to the repository variable. Please log the value of repo.titre to the report. Probably this variable doesn't contain the correct value.
But first of all I would suggest debugging if any element is found at all. For example, you could set a breakpoint after searching the elements and check if the AllCells object contains any Cell elements.
Basically, the above-mentioned code seems to be okay. I would suggest debugging the code or adding additional log information.
I assume that the condition is never true and therefore the value is not assigned to the repository variable. Please log the value of repo.titre to the report. Probably this variable doesn't contain the correct value.
But first of all I would suggest debugging if any element is found at all. For example, you could set a breakpoint after searching the elements and check if the AllCells object contains any Cell elements.
Re: Get value of row number from specific value
Hi jma,
Thank you for your reply.
I'll debug as you have advised me.
Otherwise, a colleague advised me to use the Parent operator (../) in the XPath to recognize the element and it work very well.
Thank you very much,
Thank you for your reply.
I'll debug as you have advised me.
Otherwise, a colleague advised me to use the Parent operator (../) in the XPath to recognize the element and it work very well.
Thank you very much,