mercredi 27 janvier 2021

Selenium Web Driver If-Else condition to choose button1 or button2 or button3

I'm just started to study Java if result6 = list6.toArray(result6)

  1. If result6[a] = 2 click button1
  2. If result6[a] = 3 click button2
  3. If result6[a] = 4 click button3

if ( result6[a] == 2) driver.findElement(By.xpath("//*[@id="row1"]/div[14]/img")).click();

if( result6[a] == 3) 
             driver.findElement(By.xpath("//*[@id="row2"]/div[14]/img")).click();   

if( result6[a] == 4)
driver.findElement(By.xpath("//*[@id="row3"]/div[14]/img")).click();




Aucun commentaire:

Enregistrer un commentaire