Hello experts greetings to you all,
I am a newbie
Here is my question; in my excel files linux commands are listed and placed in different cell address.
like:
A2 linuxcommand1
A5 linuxcommand1
A7 linuxcommand3
A100 linuxcommand4
now how will I pullout these linux commands using robotframework and execute them in a remoteserver?
If you can correct my code with the error below
*** Settings ***
Library SSHLibrary
Library ExcelLibrary
*** Variables ***
${HOST} 192.168.100.117
${USERNAME} root
${PASSWORD} Hitokiri
${PORT} 22
${EXCEL_FILE} D:/dev/linuxcommands.xlsx
${SHEET_NAME} Sheet1
*** Test Cases ***
Execute Commands On Remote Server
[Documentation] Execute commands on a remote Linux server
[Setup] Open Excel Document ${EXCEL_FILE} ${SHEET_NAME} mode=r
${ssh} Open Connection ${HOST} port=${PORT}
SSHLibrary.login ${USERNAME} ${PASSWORD}
@{command_cells}= Create List A2 A3 A5 A7 A10 A13 A22
FOR ${cell} IN @{command_cells}
${command}= Read Excel Cell ${SHEET_NAME} ${cell}
Run Keyword If ‘${command}’ != ‘’ Execute Command On Remote Server ${command}
END
[Teardown] Close All Connections
*** Keywords ***
Execute Command On Remote Server
[Arguments] ${command}
${output}= SSHLibrary.Execute Command ${HOST} ${USERNAME} ${PASSWORD} ${command}
Log ${output}
error: Execute Commands On Remote Server :: Execute commands on a remote … | FAIL |
ValueError: Argument ‘row_num’ got value ‘Sheet1’ that cannot be converted to integer.
thank you