Need to access Firefox browser in remote machine connected using Open Connection in Robot Testcase

212 Views Asked by At

Problem statement is: Execute Robothost Testcase -> used Open Connection keyword to connect to machineX. used Open Browser keyword to open Firefox of machineX. But instead of opening firefox browser of machineX, browser from Robothost is opening from where testcase is getting executed. But my testcase execution needs to be done on webpage opened in machineX only.

Since used Open Browser after connecting to remote machine, expecting browser of remote machine to be active. verified that connectivity to remote machine is active.

Below is sample code tried to open browser from machineX

*** Testcases ***
LaunchBrowser
    Open Connection    ${machineX}
    Sleep    5s
    Open Browser    ${base_url}
    Sleep    5s    
    Input Text    //input[@id="normal_login_username"]    admin
    Input Text    //input[@id="normal_login_password"]    admin
    Click Element    //button
    Sleep    5s
    Capture page screenshot    filename=output5g.png
    Close Browser

Any suggestions to handle this scenario

1

There are 1 best solutions below

0
Jiri Janous On

This is not how the ssh library works, in order to execute something on the machine x you need to use ssh library keywords. The selenium library will be executed on your machine. You can install robot framework on machine x and execute the test there. Otherwise you cannot use ssh library. You can trigger the test from your machine if you have to do this remotely.