The scenario is :
I am trying this code to achieve this :
Mouse over ${xpathToIdCheck}
Page Should Contain Element xpath=//*[@id="list_of_test_types"] 5s
Click Element ${User_Menu Link}
Select From List xpath=//*[@id="list_of_test_types"] STR
When I run the test, Robot framework moves the mouse over the id_Check link and we can see that the text box is appearing:
But right after that the test fails. Apparently it can find the element on the webpage , but can not locate the dropdown box to click on.
After this I tried by removing the click link command and directly went for Select from list command:
Mouse over ${xpathToIdCheck}
Page Should Contain Element xpath=//*[@id="list_of_test_types"] 5s
Select From List xpath=//*[@id="list_of_test_types"] STR
But it failed again. The feedback is as follows:
The html code is as follows:
<form action="/change_test_type_id_check?page=1&study_id=ID&test_uuid=UUID" method="post" style="display:inline">
<select class="list_of_test_types" id="list_of_test_types" name="`" onchange="this.form.submit()">
<option value="">Select a test type</option>
<option value="STR">STR</option></select>
</form>
Also if I change the code to
Select From List by Value xpath=//*[@id="list_of_test_types"] STR
This also fails with the message "NoSuchElementException: Message: Cannot locate option with value: STR"
Looking forward for your kind support. Thanks
You can try as below.
Mouse over ${xpathToIdCheck}
Page Should Contain Element xpath=//*[@id="list_of_test_types"] 5s
Click Element ${User_Menu Link}
Mouse Down xpath=//li[contains(.,'${STR}')]
Click Element xpath=//li[contains(.,'${STR}')]