Dynamic Selectors - incrementing Rows with a changing "<webctrl id="

Greetings,

I am close - very close - but there still seems to be something missing.

What I am trying to do:

  • For each excel row, look at a web-based datatable and get text from a particular ui element in the web based datatable row, and then paste the text into the excel sheet.
  • I am trying to increment the row with dynamic selectors, but it doesn’t seem to be working.

Please see the following code from the UiExplorer for the UI element of “Product ID” cell in the first row in the datatable (column circled in red)

"<html app='firefox.exe' title='Company CCC Application - Financial Model' />
<webctrl id='tblEquipment' tableRow='2' tag='TABLE' />
<webctrl id='supplierProdId1' tableRow='{{Counter}}' tag='INPUT' type='text' 
colName='Product ID' isleaf='1' tableCol='7' title='Company CCC Application - Financial Model' />"

and then for the 2nd row, which is identical to the first (except for <webctrl id='supplierProdID > ) :

"<html app='firefox.exe' title='Company CCC Application - Financial Model' />
<webctrl id='tblEquipment' tableRow='2' tag='TABLE' />
<webctrl id='supplierProdId2' tableRow='{{Counter}}' tag='INPUT' type='text' 
colName='Product ID' isleaf='1' tableCol='7' title='Company CCC Application - Financial Model' />"

Dynamic_Selector_Increment_Row_webctrlID.xaml (21.4 KB)
Forum_spreadsheet.xlsx (10.1 KB)

Unfortunately, I cannot provide the website as it is requires credentials. As you can see from the attached xaml file (and excel spreadsheet if you need it ) above, i have code for the tableRow to increment via ‘{{Counter}}’ - with an assign Counter to Counter+1.

However,it is still not incrementing. The for each excel activity is working, because for each row, it is giving me a message box, but I keep getting the message box display to say “1” - it isn’t going down the column

After quite a bit of experimenting, it looks like “<webctrl id='supplierProdId1” may need to be incremented as well? I am thinking this is the case because, as you can see above, using the UI Explorer on each successive row, the supplierProdId increases.

<webctrl id='supplierProdId1
<webctrl id='supplierProdId2
<webctrl id='supplierProdId3…

I tried to making another counter variable. So - Assign Counter2 = Counter2 + 1

So it would look like “<webctrl id='{{Counter2}}” - but it still isn’t working.

Any suggestions? Very thankful for any answers.

Hi,

In general, ID attribute is unique in the page. So, if we indicate target element with ID attribute, basically no need other attributes. For now, can you try the following?

Use ID attribute

<html app='firefox.exe' title='Company CCC Application - Financial Model' />
<webctrl id='tblEquipment' tag='TABLE' />
<webctrl id='supplierProdId{{Counter}}'  tag='INPUT'  />

Or Use other attributes without ID

<html app='firefox.exe' title='Company CCC Application - Financial Model' />
<webctrl id='tblEquipment' tableRow='2' tag='TABLE' />
<webctrl  tableRow='{{Counter}}' tag='INPUT' type='text'  colName='Product ID' isleaf='1' tableCol='7' title='Company CCC Application - Financial Model' />

Regards,

1 Like

Yoichi,

I tried both options you presented, and it is still giving me the same issue.

Any other things I could try? If you need any more information regarding the UI explorer/selector information, I am happy to provide.

Yoichi,

I figured it out.

The whole time, it was set to “do” (circled area) - setting it to sequence solved my issue.

You were of great help, however, in confirming that you don’t need 2 separate elements being incremented, just one.

I used:

<html app='firefox.exe' title='Company CCC Application - Financial Model' />
<webctrl id='tblEquipment' tag='TABLE' />
<webctrl id='supplierProdId{{Counter}}'  tag='INPUT'  />

Thank you so much -

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.