java - Selenium -- 无法定位元素
问题描述
我尝试使用 获取元素cssSelector
,但总是出现错误:无法找到元素。有什么建议吗?请帮忙!你可以参考我的代码非常感谢!
driver.switchTo().frame("contentViewInsertDialog_ctl00_ctl00_contentView_frontendPagesCreate_ctl00_ctl00_sections_mainSection_0_ctl00_0_ctl00_0_fields_0_PagesNameFieldControl_0_ctl00_0_ctl00_0_textBox_write_0");
driver.findElement(By.cssSelector("#contentViewInsertDialog$ctl00$ctl00$contentView$frontendPagesCreate$ctl00$ctl00$sections$ctl00$mainSection$ctl00$ctl00$fields$ctl01$PagesNameFieldControl$ctl00$ctl00$textBox_write")).sendKeys("Testing Page for CWP Testing");
解决方案
推荐阅读
- java - 向 JTable 添加一行时,我的所有列都消失了
- python - 正则表达式返回重复结果
- r - R中是否有任何多行注释?
- android - 在 Android 11 上调用 getPackageInfo 时出现 NameNotFoundException
- java - 无法在 Thymeleaf 中显示 Spring Boot 模型数据
- amazon-web-services - AWS 开发工具包中的重试
- vue.js - 如何在多个字段上进行 Buefy 自动完成
- r - 在 MacOS 上编译 R 中的源时出错
- excel - 当只有一行数据时,VBA Filldown 复制标题
- java - 为什么只使用 XML 元素定义 log4j 对象不起作用?