robotframework - Setting up SSH in robot framework with multiple hosts -
within robot framework, can use loop in each test case start ssh connection each host within list, , run commands on host.
but seems ssh setup happens in every test case takes considerable amount of time.
is there way in can make connection persistent every test case in test suite?
example code:
*** settings *** variables sys_variables.py resource ${resources}/common.robot *** test cases *** ping :for ${host} in @{reachable} \ ssh ${host} ${user} ${pass} \ ${result} = run , log ${ping_google_dns} \ should equal integers ${result} 0 \ log ${result}
this works, i'd not have run in every testcase.
just put tests in single suite , make connections in suite setup. suite setup executed 1 time, before actual test executions.
consider following example code:
*** settings *** suite setup suitesetup *** test cases *** test1 log test 1 test2 log test 2 *** keywords *** suitesetup log single setup
put connection cycle inside suitesetup keyword , you're done.
Comments
Post a Comment