How to click on particular element in a list using selenium webdriver?

后端 未结 1 543
灰色年华
灰色年华 2021-01-28 00:46
  1. I have a name which is coming from excel sheet
  2. List of elements, having this particular name and i need to click on this element Here is my code:

    
    
            
1条回答
  •  感动是毒
    2021-01-28 00:55

    Here it goes: Assuming your myElements will be as below:

    List myElements =driver.findElements(By.cssSelector("li[class*='rlbItem']"));
    
    for(WebElement li : myElements) 
    {
         System.out.println(li.getText());
         System.out.println();
    
         for (int i=0; i

    0 讨论(0)
提交回复
热议问题