
import orgopenqaseleniumWebDriver;
import orgopenqaseleniumWebElement;
import orgopenqaseleniumBy;
public class ByClassName
{
public static void main(String[] args)
{
WebDriver driver = new FirefoxDriver();
driverget(
);
WebElement element = driverfindElement(ByclassName("cpBtn-zj"));
Systemoutprintln(elementgetTagName());
}
}
参考这一段java代码,关键是你这个控件需要使用className来定位。
以上就是关于Selenium定位问题,用CSS,ID,name或xpath都行,怎么定位这个button.全部的内容,包括:Selenium定位问题,用CSS,ID,name或xpath都行,怎么定位这个button.、、等相关内容解答,如果想了解更多相关内容,可以关注我们,你们的支持是我们更新的动力!
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)