In this script I ask the user for the username, password & router serial for Robot Framework to navigate the website & enter the info to login & search for that router serial. The script works to ask for all three credentials but never goes away when you click the OK button after entering the serial. The rest of the script will work & fill in the information but that dialog box will not go away. Any help is greatly appreciated for this Python novice.
=======================================================================
*** Settings ***
Documentation A script that enables SSH on a router in software specified by serial number from the user.
Suite Setup Setup chromedriver
Library SeleniumLibrary
Library OperatingSystem
Library Dialogs
*** Keywords ***
Setup chromedriver
Set Environment Variable webdriver.chrome.driver ${EXECDIR}/Users/Me/PycharmProjects/Automation/chromedriver
*** Variables ***
${url} https://eco.company.com/manage
#${serial} MQ25761000110
${deviceusernum} Device.Users.User.7.X_OUI_RemoteAccess.1.X_OUI_LANRestriction
${key1} ACCESS_ENABLE
${deviceuserpass} Device.Users.User.7.Password
${key2} P@ssword1
${deviceport} Device.Users.User.7.X_OUI_RemoteAccess.1.Port
${key3} 22
*** Test Cases ***
Get Credentials
${ECO_username}= Get Value From User Enter ECO user name admin
Log To Console \n${ECO_username}
${ECO_password}= Get Value From User Enter ECO password hidden=yes
Log To Console \n${ECO_password}
${ECO_serial}= Get Value From User Enter router serial serial
Log To Console \n${ECO_serial}
[Tags] smoke test
Open Browser ${url} chrome
I resolved the issue myself by not using the RPA.Dialogs library (which is depreciated). I used the RPA.Assistant library instead with this code:
*** Settings *** Documentation A robot that enables SSH on a router in a GUI specified by serial number from the user.
Library RPA.Browser.Selenium Library RPA.Assistant Library OperatingSystem Library RPA.RobotLogListener
Suite Setup Setup chromedriver
*** Variables ***
${url} https://gui.com/manage
${deviceusernum} Device.Users.User.7.X_OUI_RemoteAccess.1.X_OUI_LANRestriction
${key1} ACCESS_ENABLE_ALL
${deviceuserpass} Device.Users.User.7.Password
${key2} P@ssw0rd1
${deviceport} Device.Users.User.7.X_OUI_RemoteAccess.1.Port
${key3} 22
*** Test Cases *** Enable SSH [Tags] smoke test
*** Keywords *** Setup chromedriver Set Environment Variable webdriver.chrome.driver ${EXECDIR}/Users/me/Documents/Python/chromedriver
Collect username Add heading GUI User Name Add text input username label=Username Add submit buttons buttons=OK,Cancel default=OK ${result}= Run dialog height=250 location=Center RETURN ${result.username}
Collect password Add heading GUI Password Add password input password label=Password Add submit buttons buttons=OK,Cancel default=OK ${result}= Run dialog height=250 location=Center RETURN ${result.password}
Collect serial Add heading Router Serial Add text input serial label=Router Serial # Add submit buttons buttons=OK,Cancel default=OK ${result}= Run dialog height=250 location=Center RETURN ${result.serial}