Hello All,
I have a data table with 5 rows(including headers). Need to write each content of each data row in a table which is opened on a website.
If I use ‘For each row’ and write the data, then when the second data row will be fetched it will overwrite the contents on the website table.
I want row 1 of Datatable to be pasted at the respective row of that website table.
The first thing I would check is the selector you are using to enter in data to the website. My guess is that the row count in that selector is not being incremented in your loop which causes the data to be overwritten instead of added below. If you need guidance with creating a dynamic selector I can help you with that if you provide me the selectors for data entry.
For example when selecting a row and column with the UIExplore for something and it is in a table format, many time we will get a selector which looks like the following.
Try selecting your table row with the UIExplore tool and see if you can include table columns and rows and then increment them inside your loop. If that is not possible, you can also try selecting the first row, the second row and the third row and see what the differences in the selector are and then try to create a selector that increments in each loop.
Yeah, did the same. Clearly there is one number that keeps on changing. Now initializing a variable with 1 and will keep on incrementing i inside the loop.
Will let you know if I am stuck at anypoint.
You would create a string variable and a integer variable. Name the string ‘DynamicSelector’ and the integer ‘count’ or other names that gives you information about the variable. Then inside the loop you would assign it like this:
and increase count inside your loop at then end. Use the ‘DynamicSelector’ variable in the selector space of the activity where you are writing data inside the table.
Also if there is more to your selector, make sure to include the entire selector in the assign ‘DynamicSelector’ step on a single line, no newlines.
Hi, I cannot do this, as row is same but columns are diferent. So not every selector is of <Webctrl id=A241Nidisplay… some are <webctrl id=B_1_xyz…
so ‘1’ is common through out, so just need to replace the dynamic part in the selectors with variable ‘count’
How to do that?
Try adding in the count variable to each selector individualy and see if that syntax works
<webctrl id=‘A242N"+count.toString+"display’
If that doesn’t work, do multiple assigns where you assign a new selector to ‘DynamicSelector’ before each column to write in and replace the selectors with ‘DynamicSelector’
Yeah, tried option 1 yesterday, but that syntax was not right.
Will try to do option 2. will assign diff values in same variable before writing into the column.
Thanks.