Hi all,
I have been having intermittent problems with the Selenium keyword Input Text. I am hoping for some pointers on how I can track this down.
The problem is that the Input_Text keyword would SOMETIME not enter the text into the textbox. A test would run fine in 1 build and fail in the next build because the textbox did not contain the input text. Once my test case encountered this problem, none of the Input_Text keywords would enter the text as expected. Other form interactions such as Click_Element or Select_From_List would still work.
Background:
CentOS 6
Firefox 10
Python 2.6 (Python 2.6.6 (r266:84292, Sep 11 2012, 08:34:23))
Selenium 2.25.0 (selenium-2.25.0-py2.6.egg-info)
Robotframework 2.7.6 (robotframework-2.7.6-py2.6.egg-info) and (robotframework_selenium2library-1.0.1-py2.6.egg-info)
Testing a Web application with AJAX and jQuery rendering.
I have tried checking the text on the element after the Input_Text keyword, and retry the Input_Text keyword if needed.
I even tried Reload_Page before retrying the Input_Text keyword.
I have made sure the element is visible before the Input_Text keyword.
I have Capture_Page_Screenshot and can see that the element is visible.
I log the "style" attribute of the element and all of its direct ancestors to make sure they don't have "display: none" value.
None of these helped or gave any clues.
Below is my custom keyword. When the problem occurs, ${entered_text} would always be blank, and the test case would time out from the keyword Wait_Until_Keyword_Succeeds on UI_Input_Text_And_Verify. I attached here a snippet of my debug log.
UI_Input_Text [Arguments] ${locator} ${text}
Wait_Until_Page_Contains_Element ${locator}
Wait_Until_Keyword_Succeeds ${VISIBILITY_TIMEOUT} ${VISIBILITY_RETRY}
... UI_Input_Text_And_Verify ${locator} ${text}
UI_Input_Text_And_Verify [Arguments] ${locator} ${text}
Wait_Until_Keyword_Succeeds ${VISIBILITY_TIMEOUT} ${VISIBILITY_RETRY}
... Element_Should_Be_Visible ${locator}
Input_Text ${locator} ${text}
${entered_text}= Get_Value ${locator}
Should_Be_Equal ${text} ${entered_text}