“value error: Element locator did not match any element.” while trying to locate a element

半腔热情 提交于 2019-12-08 04:54:53

问题


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>

I am using cmd

Click Element   id=ctl00_ResultPanePlaceHolder_ctl00_ctl02_ctl01_contentContainer_ddlLanguage

I am getting

value error: Element locator did not match any element.

How to fix this issue.


回答1:


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.




回答2:


You should need to use id= as ID is one of the default attributes it looks for. Is it possible to see some more of the html code surrounding the element you are after?



来源:https://stackoverflow.com/questions/25645692/value-error-element-locator-did-not-match-any-element-while-trying-to-locate

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!