Highlighted
Absent Member.
Absent Member.
227 views

Parameterize XPath Object Identification

I am writing a script to select a checkbox in a row from table, and either click yes or no. However, once I finish that checkbox the checkbox cannot be used again since it is already been given a yes or no. 

I am trying to parameterize a number given from the XPath from the object identification. The Xpath given as, (for 3 rows):

//form[@id="matchAndSettleForm"]/table/tbody/tr[4]/td/div/div[3]/table/tbody/tr[1]/td[1]/div/div[2]
//form[@id="matchAndSettleForm"]/table/tbody/tr[4]/td/div/div[3]/table/tbody/tr[2]/td[1]/div/div[2]
//form[@id="matchAndSettleForm"]/table/tbody/tr[4]/td/div/div[3]/table/tbody/tr[3]/td[1]/div/div[2]

As you see, the third digit (red) corresponds to the row that the checbox is in that the script will select. I need to parameterize that number so that the script will work for multiple pages. I will have to go through over 3000 rows, so I will need a way to make the script work for every page. Also, the table has 25 rows per page, so once the 26th iteration comes, it will need to be back at 1 again since the 1st row on the second page is still the 1st row, not the 26th. 

Is there a way to do this?

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.