Using already opened Browser window in Robot framework

前端 未结 2 1610
星月不相逢
星月不相逢 2021-01-24 06:33

We are using Robot Framework for writing/automating acceptance test cases.

Every time i need to run the whole script to check the last lines of code of my script, That

相关标签:
2条回答
  • 2021-01-24 07:04

    What you ask is not directly possible with Robot/Selenium, but from what you write, I can see room for some improvements:

    • "creates lots of duplicate records in the system" => you should have Teardown in your tests that clean the system when the tests are finished (and teardown are run even when there is a failure). So next time you run the tests, the system starts clean
    • "That Wastes lot of time" => if your tests are too long to run, maybe you should consider splitting them in smaller chunks. And also consider running part of your tests directly via the REST or SOAP interface instead of the browser.
    0 讨论(0)
  • 2021-01-24 07:04

    Here is a geckodriver example for Firefox (win)

    Start your Firefox with marionette enabled (standard port is 2828)

    "C:\Program Files\Mozilla Firefox\firefox.exe" --marionette
    

    Robot example script

    *** Settings ***
    Library           SeleniumLibrary
    
    *** Variables ***
    ${BROWSER}          Firefox
    ${GECKODRIVER EXE}  c:/MY_GECKODRIVER_PATH/geckodriver.exe
    ${GECKODRIVER LOG}  C:/MY_GECKODRIVER_LOG_PATH/log.txt
    
    *** Test Cases ***
    Firefox Browser Test
        Init Webdriver
        Go To   https://www.google.com
    
    *** Keywords ***
    Init Webdriver
        ${service_args}=     Create List    --connect-existing    --marionette-port=2828    --marionette-host=127.0.0.1
        Create Webdriver     ${BROWSER}        executable_path=${GECKODRIVER EXE}   service_args=${service_args}    service_log_path=${GECKODRIVER LOG}
    
    0 讨论(0)
提交回复
热议问题