“值错误:元素定位器不匹配任何元素."在尝试定位元素时 [英] "value error: Element locator did not match any element." while trying to locate a element

查看:88
本文介绍了“值错误:元素定位器不匹配任何元素."在尝试定位元素时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用带有 Selenium2Library 的 Robot Framework 进行网站测试自动化.我的 HTML 值是

I am using Robot Framework with Selenium2Library for website tests automation. My HTML Value is

<select class="autoWidth m![Element Locator Error][1]inWidth" id="ctl00_ResultPanePlaceHolder_ctl00_ctl02_ctl01_contentContainer_ddlLanguage" name="ctl00$ResultPanePlaceHolder$ctl00$ctl02$ctl01$contentContainer$ddlLanguage">
<option value=![enter image description here][2]"1118">አማርኛ &lrm;(ኢትዮጵያ)&lrm;</option>

我正在使用 cmd

Click Element   id=ctl00_ResultPanePlaceHolder_ctl00_ctl02_ctl01_contentContainer_ddlLanguage

我要了

value error: Element locator did not match any element.

如何解决这个问题.

推荐答案

很可能您的元素位于 iframe 内.查看 html 以查看是否在您尝试单击的元素之前看到 <iframe ...>.如果是这样,您首先需要使用 Select Frame 之前试图点击元素.

Most likely your element is inside an iframe. Look through the html to see if you see <iframe ...> before the element you are trying to click. If so, you first need to use Select Frame before trying to click on the element.

这篇关于“值错误:元素定位器不匹配任何元素."在尝试定位元素时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆