Getting the div index
Getting the div index
Hello,
I am testing now the Ranorex for our company needs. We can decide to use Ranorex, but only if it can serve us well. We using ExtJs and I have some troubles with element identification. Now my main question is about a table:
is there a way of getting the div index of one element? I have the innertext, and need the div index....
I am using VB.net..
I am testing now the Ranorex for our company needs. We can decide to use Ranorex, but only if it can serve us well. We using ExtJs and I have some troubles with element identification. Now my main question is about a table:
is there a way of getting the div index of one element? I have the innertext, and need the div index....
I am using VB.net..
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: Getting the div index
Hello,
This should be possible, but in order to analyze the issue in detail we would need a Ranorex Snapshot file of your table, would this be possible?
You can post it here or you can also send it to our support mail address: [email protected].
Following link will show you how to generate a snapshot file:
Creating Ranorex Snapshot Files.
Thanks,
Markus
Ranorex Support Team
This should be possible, but in order to analyze the issue in detail we would need a Ranorex Snapshot file of your table, would this be possible?
You can post it here or you can also send it to our support mail address: [email protected].
Following link will show you how to generate a snapshot file:
Creating Ranorex Snapshot Files.
Thanks,
Markus
Ranorex Support Team
Re: Getting the div index
Hello,
I sent the snapshot per Email.
Looking forward to hearing from you soon!
I sent the snapshot per Email.
Looking forward to hearing from you soon!
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: Getting the div index
Hi,
Thanks for the snapshot!
Please take a look at the two attributes of the specific TR tag "viewIndex" or "viewRecordId", these attributes should include the information you wanted to get.
If these values of the attributes are the wrong values we would need a Ranorex snapshot of the entire table in order to analyze the issue in detail.
You can get these attributes with the Get Value action as shown in the attached recording file.
Regards,
Markus
Ranorex Support Team
Thanks for the snapshot!
Please take a look at the two attributes of the specific TR tag "viewIndex" or "viewRecordId", these attributes should include the information you wanted to get.
If these values of the attributes are the wrong values we would need a Ranorex snapshot of the entire table in order to analyze the issue in detail.
You can get these attributes with the Get Value action as shown in the attached recording file.
Regards,
Markus
Ranorex Support Team
You do not have the required permissions to view the files attached to this post.
Re: Getting the div index
Hello,
This does not help me....the point is, that I need to find the tr/td index of the current cell (Name). Because I want to use that in general, where I dont have any value in a cell. The other point is, that the cell I may need is not every time in the same row. That's why I just thought that I can use vb.net to make a manual function and use it, when I want to find any cell place
For example, if I can find the row index of the 'Name' cell, then I can also find the column index(td) of another cell, for which I also have a value, and then I can alone prepare this regexp, according to tr/td indexes for the cell I need....
Is it possible to find this index, using an user code? Or maybe my question is in the wrong place?
Thank you and best of regards!
This does not help me....the point is, that I need to find the tr/td index of the current cell (Name). Because I want to use that in general, where I dont have any value in a cell. The other point is, that the cell I may need is not every time in the same row. That's why I just thought that I can use vb.net to make a manual function and use it, when I want to find any cell place
For example, if I can find the row index of the 'Name' cell, then I can also find the column index(td) of another cell, for which I also have a value, and then I can alone prepare this regexp, according to tr/td indexes for the cell I need....
Is it possible to find this index, using an user code? Or maybe my question is in the wrong place?
Thank you and best of regards!
Re: Getting the div index
Make a list out of it.
IList<Ranorex.DivTag> myList = tag.findDescendents<Ranorex.DivTag>();
Call the index of the list:
myList[0]
Perform operations
myList[0].InnerText
IList<Ranorex.DivTag> myList = tag.findDescendents<Ranorex.DivTag>();
Call the index of the list:
myList[0]
Perform operations
myList[0].InnerText
Re: Getting the div index
Thank you!
Can you also tell me, if one div is in a table, and I know the div, how can I find the correspondent tr and td index ? I will very appreciate!
Example code (I have the div with id=description, i want to find the tr index and td index. Here is for example tr[2]td[1])
<tr>
</tr>
<tr>
<td id="ext-gen1053" class="lty_iboxDscr ">
<div id="description" class="lty_iboxDscr Nov ">Name:<span class="requiredfield lty_requiredStar"></div>
</td>
<td id="ext-gen1066" class="lty_iboxCntin">
<input id="uq917" name="p_sName" maxlength="300" vtype="required;" onkeyup="javascript:try{iboxValidate(this)}catch(ex){};;" onchange="javascript:changeForm();" class="lty_inputText w264 " value="Hello" autocomplete="on" type="text"></td>
<td>
<a boxid="metaBox" class="lty_iboxHdLnk" onclick="javascript:openPage(1,'-1','-1','NAME','73822','-1','-1','testing');;"></a>
</td>
</tr>
Can you also tell me, if one div is in a table, and I know the div, how can I find the correspondent tr and td index ? I will very appreciate!
Example code (I have the div with id=description, i want to find the tr index and td index. Here is for example tr[2]td[1])
<tr>
</tr>
<tr>
<td id="ext-gen1053" class="lty_iboxDscr ">
<div id="description" class="lty_iboxDscr Nov ">Name:<span class="requiredfield lty_requiredStar"></div>
</td>
<td id="ext-gen1066" class="lty_iboxCntin">
<input id="uq917" name="p_sName" maxlength="300" vtype="required;" onkeyup="javascript:try{iboxValidate(this)}catch(ex){};;" onchange="javascript:changeForm();" class="lty_inputText w264 " value="Hello" autocomplete="on" type="text"></td>
<td>
<a boxid="metaBox" class="lty_iboxHdLnk" onclick="javascript:openPage(1,'-1','-1','NAME','73822','-1','-1','testing');;"></a>
</td>
</tr>
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: Getting the div index
Hi,
You can get an attribute of a parent element as I showed it in my uploaded sample recording.
Use the RxPath of the div tag and add the following expression in order to identify the parent element: <RxPath of DivTag>/../, this would identify the td tag.
You can get the value of a specific attribute of a specific repo item with the "Get Value" action as shown in my sample.
Regards,
Markus
Ranorex Support Team
You can get an attribute of a parent element as I showed it in my uploaded sample recording.
Use the RxPath of the div tag and add the following expression in order to identify the parent element: <RxPath of DivTag>/../, this would identify the td tag.
You can get the value of a specific attribute of a specific repo item with the "Get Value" action as shown in my sample.
Regards,
Markus
Ranorex Support Team
Re: Getting the div index
Hello,
thank you for the answer. I managed to cope with that, but I have another problem. I have one functionality, which I cannot test, if I dont find a way to locate a cell..
For that I need to find the row, where this cell is, according to another cell
(because this cell will not be at the same place each time)
I have:
/html/body/div[5]/div[2]/div/div/div[4]/div/div/div[2]/div/table/tbody/tr[13]/td id="ext-gen1576" class=" xty_flxgridBorderTRL x-grid-cell" style="; text-align: center;" unselectable="on">myCell</div></td>
So, I need to find the number in bracket in tr[13], according to the place of //div[@inertext='myCell'].
I have 5 more days to finid a way to test this, in order to decide if I will do with ranorex or not......so will be grateful if anyone can help me!
thank you for the answer. I managed to cope with that, but I have another problem. I have one functionality, which I cannot test, if I dont find a way to locate a cell..
For that I need to find the row, where this cell is, according to another cell
(because this cell will not be at the same place each time)
I have:
/html/body/div[5]/div[2]/div/div/div[4]/div/div/div[2]/div/table/tbody/tr[13]/td id="ext-gen1576" class=" xty_flxgridBorderTRL x-grid-cell" style="; text-align: center;" unselectable="on">myCell</div></td>
So, I need to find the number in bracket in tr[13], according to the place of //div[@inertext='myCell'].
I have 5 more days to finid a way to test this, in order to decide if I will do with ranorex or not......so will be grateful if anyone can help me!
Re: Getting the div index
Put it in a loop and maybe do:
tr[13].moveto();
Find descendents, look in the local variables of the list, and locate the index of the required cell. Move to that index.
I'd need to understand the problem more.
tr[13].moveto();
Find descendents, look in the local variables of the list, and locate the index of the required cell. Move to that index.
I'd need to understand the problem more.
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: Getting the div index
Hello,
If I got the question correctly you have to make the following:
In order to get the index of the tr tag you can use the childindex(attribute) +1, because it starts with 0 and the index starts with 1.
Just make the same as shown in my sample and add a GetValue action with "childindex" as attribute/name.
You can also make this in UserCode:
Markus
Ranorex Support Team
If I got the question correctly you have to make the following:
In order to get the index of the tr tag you can use the childindex(attribute) +1, because it starts with 0 and the index starts with 1.
Just make the same as shown in my sample and add a GetValue action with "childindex" as attribute/name.
You can also make this in UserCode:
YourVariable = YourRepoElement.Element.GetAttributeValue("childindex").ToString();Regards,
Markus
Ranorex Support Team
Re: Getting the div index
Thank you to all of you!
I found the cell, but stil have problems with finding elements
With highlight element I can always find them, but during the run process, sometimes are found, sometimes not, althought they are there!
Dont know what to do, normally this happens in a separate (popup) window....
Any idea, what could be different?
Can the problem be in @class attribute that I am using to catch element?
I found the cell, but stil have problems with finding elements
With highlight element I can always find them, but during the run process, sometimes are found, sometimes not, althought they are there!
Dont know what to do, normally this happens in a separate (popup) window....
Any idea, what could be different?
Can the problem be in @class attribute that I am using to catch element?
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: Getting the div index
Hi,
It could be that you are using an attribute in your RxPath which will change after a restart of your AUT.
Could you please send us a Ranorex Snapshot file of that pop up window, including the specific not found element and the RxPath you are using in order to find the element?
Do you have installed the full version of the .Net 4.0 framework?
Thanks,
Markus
Ranorex Support Team
It could be that you are using an attribute in your RxPath which will change after a restart of your AUT.
Could you please send us a Ranorex Snapshot file of that pop up window, including the specific not found element and the RxPath you are using in order to find the element?
Do you have installed the full version of the .Net 4.0 framework?
Thanks,
Markus
Ranorex Support Team
Re: Getting the div index
No, I have 3.5 Framework...I will install the 4.0 then.
Otherwise, no, the element is not changed, because if I use highlight element option from the repository (clicking over the element), it finds it, but during the playback, it does not find it...it is always the first searched element /the first action/ in the new window . I wil investigate more.
The problem is more reproducable in IE, instead of FF..
Otherwise, no, the element is not changed, because if I use highlight element option from the repository (clicking over the element), it finds it, but during the playback, it does not find it...it is always the first searched element /the first action/ in the new window . I wil investigate more.
The problem is more reproducable in IE, instead of FF..
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: Getting the div index
Hi,
Could it be that you are using rooted folders? If so, please check if the "Use Cache" property is set to false.
It should also run with 3.5, there is no need to update, I just asked because there are some issue if you just installed the client version of the .Net 4.0 framework.
Regards,
Markus
Ranorex Support Team
Could it be that you are using rooted folders? If so, please check if the "Use Cache" property is set to false.
It should also run with 3.5, there is no need to update, I just asked because there are some issue if you just installed the client version of the .Net 4.0 framework.
Regards,
Markus
Ranorex Support Team