-
Notifications
You must be signed in to change notification settings - Fork 751
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"InvalidElementStateException: Message: invalid element state" error showing for "Input Text //*[@id="search"] never" command #1838
Comments
You mentioned in the other thread
Selenium's error messages are very telling in that they point towards the issue. InvalidElementStateException means "the element is in an invalid state" [reference] which for a input text keyword this generally means it is disabled. As you just opened the browser and navigated to the site I suspect you just need to wait for the input to be enabled. A quick check would be to temporarily add a sleep before inputting the text. If that works then you should consider your waiting strategy for the application under test to be "ready" before proceeding. |
Hi thanks for replying. I have added two extra lines but it is still showing same error. I have attached the log file. Element Should Be Enabled //[@id="search"] this step is passed but Input Text //[@id="search"] never this step is failed, how is this possible? |
@emanlove thanks a lot, it is working properly. |
Hi, *** Test Cases *** I am getting error like this
|
System Conditions :
Browser: Google Chrome Version 114.0.5735.110 (Official Build) (64-bit)
Browser driver: Chrome WebDriver version: 114.0.5735.90
Operating System: Windows 11 Pro
I am using selenium 4.9.0 and Robot Framework 6.1 (Python 3.11.3 on win32 )
Steps followed :
I am trying to execute simple testcase but it is throwing error for "Input Text //*[@id="search"] never" command, I have pasted my script below. Please check. I am using Xpath as selector.
*** Settings ***
Library SeleniumLibrary
*** Test Cases ***
Sample Test Case for verifying the basic functionality
[Documentation] Test case documentation
Open Browser https://www.youtube.com chrome
Maximize Browser Window
Input Text //*[@id="search"] never
Press Keys //*[@id="search-icon-legacy"]/yt-icon/yt-icon-shape/icon-shape/div [RETURN]
# Add more test steps if needed
Page Should Contain never
Sleep 5s
Close Browser
*** Keywords ***
Expected Output : It should input the text in the search option of YouTube.
I have attached log file. I have used other website's search box, it is working properly( if you change the selector but for YouTube it is showing error. Please let me know if any additional details is needed. I appreciate any help.
log.pdf
The text was updated successfully, but these errors were encountered: