isElementPresent in selenium 2.0

前端 未结 6 1392
太阳男子
太阳男子 2021-02-19 11:09

Hello all I am using webdriver so if I want to use selenium;s rc function isElementPresent I have to emulate selenium rc so I do something like this:

import org.         


        
6条回答
  •  误落风尘
    2021-02-19 11:15

    I really like Rostislav Matl's alternative Moving to Selenium 2 on WebDriver, Part No.1:

    driver.findElements(By.className("someclass")).size() > 0;
    

    Javadoc: org.openqa.selenium.WebDriver.findElements(org.openqa.selenium.By by)

提交回复
热议问题