I'm trying to find an element but I receive error element not found My code:
Dim bot As WebDriver
Set bot = New WebDriver
bot.Start "chrome"
bot.Get "http://..."
bot.FindElementByName("userName").SendKeys "text"
bot.FindElementByName("password").SendKeys "text"
bot.FindElementByClass("ButtonLast").Click
bot.FindElementByName("searchField").SendKeys "text"
Stop
HTML:
<input
class="SearchRoundCorner"
onblur="searchFieldInnerTxt(this);"
onfocus="searchFieldInnerTxt(this);"
style="width: 150px; padding-left: 20px; color: rgb(128, 128, 128);"
type="text"
name="searchField"
value="search"
title=""
onkeypress="if ((window.event && window.event.keyCode == 13)|| event.which==13){ document.ListView.pageNo.value=1;document.ListView.saveSelection.value = 0;submitForm(document.ListView);return false; }"
/>
It works well until I get to that line-bot.FindElementByName("searchField").SendKeys "text"
Error:
Error message:Run-Time Error 7 NoSuchElementError Element not found for name=searchfield