selenium webdriver元素定位 如果存在两个相同的class怎么定位
1个回答
展开全部
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.By;
public class ByClassName
{
public static void main(String[] args)
{
WebDriver driver = new FirefoxDriver();
driver.get(
);
WebElement element = driver.findElement(By.className("cpBtn-zj"));
System.out.println(element.getTagName());
}
}
import org.openqa.selenium.WebElement;
import org.openqa.selenium.By;
public class ByClassName
{
public static void main(String[] args)
{
WebDriver driver = new FirefoxDriver();
driver.get(
);
WebElement element = driver.findElement(By.className("cpBtn-zj"));
System.out.println(element.getTagName());
}
}
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询