r/selenium • u/TIMTBTBTBT • Sep 21 '20
Python/selenium
Can someone help with why I am getting this error? I am new to scripting but this has had me stuck for a few days now. (I have to use internet explorer). Thanks so much for all your help!
ERROR: selenium.common.exceptions.NoSuchElementException: Message: Unable to find element with css selector == input.k-textbox
HTML: <input class="k-textbox" type="text" placeholder="User Name" data-bind="attr: {maxlength: _maxLength, style: _style, placeholder: _placeholder}, disable: _disabled, textInput: _value, setFocus: _viewActions, focus: _hasFocus">
driver = webdriver.Ie(IEDriverManager().install())
#this will open up the HighJump Site
url = "http://hjweb.theblacktux.net:30000/workspace/Default.html"
driver.get(url)
driver.implicitly_wait(20)
username = driver.find_element_by_css_selector("input.k-textbox")
username.send_keys("sa")
driver.find_element_by_name("submit").click()
0
Upvotes
1
u/ProfCrumpets Sep 22 '20
Can you wait until element is visible first, then click it?
It may not be present when the page loads and the script start.