Hi there,
Is there a way I can access a textbox in an array of textboxes dynamically based on a column header?
The structure I have is:
containerMain
container1
table
column[@text='Name']
container2
container
textbox (This is the textbox I want to refer to dynamically based on container1\table\column[@text='Name']
I have included a snapshot of the structure
Thanks,
Brad.
Access TextBox dynamically
Access TextBox dynamically
You do not have the required permissions to view the files attached to this post.
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: Access TextBox dynamically
Hi Brad,
I am not totally sure I completely got your question, but in order to select one of the textboxes "dynamically" you could use the "TabIndex" attribute which is equal to the "Index" attribute of the column.
Regards,
Markus
I am not totally sure I completely got your question, but in order to select one of the textboxes "dynamically" you could use the "TabIndex" attribute which is equal to the "Index" attribute of the column.
Regards,
Markus
Re: Access TextBox dynamically
Basically there is 2 child containers under the parent container. The first container has another child container that contains an array of textboxes. Under these textboxes is the 2nd child container which contains a table of columns and rows. When you drag the column headers horizontally the corresponding textbox moves with it. I need to refer to 'TTSign1' (see new attachment 'FindList.png') based on the column "Name" regardless of where it is moved to (dynamically).
This is easy to do if I refer to the textbox with a hardcoded TabIndex, but if the column header gets moved, it no longer refers to the "Name" column.
Based on the ranorex snapshot I provided how would I refer to 'TTSign1' dynamically with a RanoreXPath??
This is easy to do if I refer to the textbox with a hardcoded TabIndex, but if the column header gets moved, it no longer refers to the "Name" column.
Based on the ranorex snapshot I provided how would I refer to 'TTSign1' dynamically with a RanoreXPath??
You do not have the required permissions to view the files attached to this post.
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: Access TextBox dynamically
Hello,
You could try to use the following path to get your column 'Name' even if it is moved:
Please try it out and let me know if this works in your case.
Thank you in advance.
Regards,
Markus (T)
You could try to use the following path to get your column 'Name' even if it is moved:
Code: Select all
/form[@controlname='MainForm']//container[@controlname='listBorderControl']/table/column/cell[@text='Name']/../cell[@text='TTSign1']
Thank you in advance.
Regards,
Markus (T)
Re: Access TextBox dynamically
It almost works ... it finds the textbox below the header instead of above it (which is in a separate container)
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: Access TextBox dynamically
Hello,
I am not sure if I got your use case completely.
Why do you want to access a textbox in that way?
Could you please describe step-by-step what you want to do?
Thank you in advance.
Regards,
Markus (T)
I am not sure if I got your use case completely.
Why do you want to access a textbox in that way?
Could you please describe step-by-step what you want to do?
Thank you in advance.
Regards,
Markus (T)