*设置*
Library SeleniumLibrary
*变量*
${Browser} Firefox
${URL} https://allegis.ramcocloud.com/RVW/extui/vwrt/LaunchPanel.htm
*测试用例*
TC1 Browser Start and close
Open Browser ${URL} ${Browser}
Input Text name:ide_username INR004914
Input Text xpath://input[@name='ide_password'] tsip890*()
我想错误是在第一个“输入文本”上。尝试复制它的xpath,就像您在下面所做的说明一样
Input Text xpath://input[@name='ide_username'] INR004914
似乎您很近。所需的元素是启用JavaScript的元素,因此您需要诱导wait,并且可以使用(合并)两个侍者中的任一个,也可以使用以下Locator Strategies:
诱导Wait Until Element Is Visible
:
TC1 Browser Start and close
Open Browser ${URL} ${Browser}
Wait Until Element Is Visible xpath://input[@id='ide_username' and @name='ide_username'] 20 seconds
Input Text xpath://input[@id='ide_username' and @name='ide_username'] INR004914
Input Text xpath://input[@name='ide_password'] tsip890*()
诱导Wait Until Element Is Enabled
:
TC1 Browser Start and close
Open Browser ${URL} ${Browser}
Wait Until Element Is Enabled xpath://input[@id='ide_username' and @name='ide_username'] 20 seconds
Input Text xpath://input[@id='ide_username' and @name='ide_username'] INR004914
Input Text xpath://input[@name='ide_password'] tsip890*()
您可以在
Wait Until Element Is Visible
中找到有关Wait Until Element Is Enabled
和How to click a row that has javascript on click event in RIDE的详细讨论
一些参考: