-1

I have a table where I need to add 8 rows and select the dropdown value in the first field and enter input values in the second and third field

Table:

The table has 3 fields

  1. First field is a dropdown
  2. Second Field is an input field
  3. Third field is also an input field

Next to the third field there is an Add and Delete button where I can Add a Row or Delete the Row

My Scenario :

Since the 1st field which is a drop down has 8 values in the dropdown list - I need to add 8 Rows in order to select all the values in the drop down list and also will have to key in the values for the second and third field.

My Requirement :

  1. I need to click on the Add button
  2. I need to select and enter the values in all the 8 rows and in this Case I want to take only one common Xpath for the first field, one Xpath for the Second field and one Xpath for the third field. But it is not working

What I have tried

I have taken one Xpath for the first row, one Xpath for the second row, and one Xpath for the third row.

Issue: and it happens to click only the first row for all the 3 fields


I can add more information if needed. Can I get some leads on this?
3
  • 1
    What is the code you are trying to use? You may need to use DOM traversal as the second and later rows don't exist until you've added them.
    – Kate Paulk
    Aug 19 at 11:36
  • i tried traversing but not working any inputs will be helpful
    – sandy
    Aug 19 at 13:13
  • I recommend adding rows manually, then using the browser tools to inspect the HTML that results. Please post the HTML code here: I suspect you will find that there is no difference in the HTML for each row. Please also post the code you are using to try to interact with the HTML. We do not have enough information to help you with the question as it stands.
    – Kate Paulk
    Aug 20 at 11:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.