当我尝试编写XPath时,序列就会从ifame/#document/html
中断。我想要从我尝试使用的div[@id='zdaasmodalbody']
开始,切换到窗口/框架,但都不起作用。
我试过这段代码,但是工具找不到元素来识别它的XPath:
cClickWait("/html/body/app-root/app-nav-menu/nav/a", "XPath");
发布于 2019-10-22 10:18:19
您可以使用下面的Xpath
//div[@id='zdaasmodalbody']//iframe[@class='ng-scope']
或
//iframe[@class='ng-scope']
或
//iframe[@class='ng-scope' and contains(@src,'https://')]
在对其子元素进行操作之前,需要先切换到frame,如下所示
您可以像这样进行切换:
driver.SwitchTo().Frame(driver.FindElement(By.Xpath("//div[@id='zdaasmodalbody']//iframe[@class='ng-scope']")));
https://stackoverflow.com/questions/58485600
复制相似问题