jeudi 23 avril 2020

How to use Assert command?

So, I am not sure why my Assertion is not working. Can you please point the mistake? PS. I am new to programming and selenium.

driver.findElement(By.xpath("//li[contains(text(),'Round Trip')]")).click();
         if (driver.findElement(By.xpath("//li[contains(text(),'Round Trip')]")).isEnabled() ) {
            Assert.assertTrue(driver.findElement(By.xpath("//li[contains(text(),'Round Trip')]")).isSelected());

         }

I am getting below error in console:

enter image description here

Aucun commentaire:

Enregistrer un commentaire