webdriver classname with space using java

后端 未结 3 1727
栀梦
栀梦 2020-12-13 07:19

This question received great answers in jquery and I was wondering if someone could give an example of this in Java please?

I\'m doing driver.findElement(

3条回答
  •  萌比男神i
    2020-12-13 08:09

    For a less fragile test, another option is to use an XPATH which doesn't depend of the order of classes, like:

    WebElement element = driver.findElement(By.xpath("//a[contains(@class, 'current') and contains(@class, 'time')]"));
    

提交回复
热议问题