问题
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">አማርኛ ‎(ኢትዮጵያ)‎</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