首页 > 解决方案 > 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");

标签: javaeclipseseleniumtesting

解决方案


推荐阅读