03-03-2009, 08:47 PM
Situation: A table in a page displays requirement items to be (mentioned/saved) completed. Test should complete all of them more or less one by one. Two types of requirements: To complete one of the types, check the checkbox and click save; To complete the other type (which would not have checkbox), select the row (by clicking a link in the row) and navigate to different page to complete the process.
Skip this section - Please use this section to further understanding:
Assume a table with some #rows. Total number of rows change, so only after the page loads we know. #columns with column title is fixed (which is 6). As far as the data in each row, there are two types of rows.
1. rows that have a checkbox in the first column.
2. rows that do not have a checkbox in the first column
Both type of rows have a link (in order to select the row for further processing) at the 3rd column.
The test should do the following 2 steps:
Step 1: Set the checkbox checked on all the checkbox rows and click a button (save). This button is in the same page but not in this table. Clicking this save button/link is easy as it is unique. Clicking Save reloads the same page. [Advantage: these are the only checkboxes in the page. Again, order does not matter, test needs to check all of them and click the save button/link]
Step 2: Select (click on the link at 3rd column of the row) the rows (that do not have checkboxes) one by one and navigate to different page to do a process and get back. Repeat step 2 untill all such rows are done. [Advantage: navigation link to further process will not be visible or available until the rows is selected]
Could you please give me some scripting ideas for the following:
1. Can I find out total # of checkboxes and access individually to set them checked? Any script ideas...
2. Similarly finding #of rows (that do not have checkboxes), then click in the order they appear to do process?
Appreciate your ideas and time
Skip this section - Please use this section to further understanding:
Assume a table with some #rows. Total number of rows change, so only after the page loads we know. #columns with column title is fixed (which is 6). As far as the data in each row, there are two types of rows.
1. rows that have a checkbox in the first column.
2. rows that do not have a checkbox in the first column
Both type of rows have a link (in order to select the row for further processing) at the 3rd column.
The test should do the following 2 steps:
Step 1: Set the checkbox checked on all the checkbox rows and click a button (save). This button is in the same page but not in this table. Clicking this save button/link is easy as it is unique. Clicking Save reloads the same page. [Advantage: these are the only checkboxes in the page. Again, order does not matter, test needs to check all of them and click the save button/link]
Step 2: Select (click on the link at 3rd column of the row) the rows (that do not have checkboxes) one by one and navigate to different page to do a process and get back. Repeat step 2 untill all such rows are done. [Advantage: navigation link to further process will not be visible or available until the rows is selected]
Could you please give me some scripting ideas for the following:
1. Can I find out total # of checkboxes and access individually to set them checked? Any script ideas...
2. Similarly finding #of rows (that do not have checkboxes), then click in the order they appear to do process?
Appreciate your ideas and time