I am working on this grid, using SELENIUM & JAVA and chromedriver.
Take a look at this and it's behaviour (it is a .gif):
When i need to add a new row to that grid i have to click on "ADD OPTION" and then a new row is inserted
The problem is that i do not understand how to pass a collection of values, i want to achieve this:
I want to pass a collection and my program should place them in the grid (2 values each row) without getting the xpath of every single box. I need to make it more efficient.
Example: i have this collection:
["fdfdfddf","989"; "RERE","6655"; "HEHE","554"; "TTER","89"]
I want my program to place them in the GRID.
The problem is that in my code i do need to know the xpath of each "box" of the grid in order to insert data.
This is my code to add data to the grid:
driver.findElement(By.id("add_new_option_button")).click(); //it clicks on "Add Option" button
driver.findElement(By.xpath("//*[@id=\"manage-options-panel\"]/table/tbody/tr[40]/td[3]/input")).sendKeys("fdfdfddf");
driver.findElement(By.xpath("//*[@id=\"manage-options-panel\"]/table/tbody/tr[40]/td[5]/input")).sendKeys("989");
driver.findElement(By.id("add_new_option_button")).click();
How can i fill in the boxes without knowing the xpath of every box?
I don't want to click on every box of each row to get the xpath, i need to find another fast solution.
This is how i get the xpath of every box:


