문제

*** Settings ***

*** Test Cases ***
Browser Shutdown

*** Keywords ***
Browser Shutdown
    Close Browser

file closebrowser.txt contains no keyword error shown when run this file. I just want to execute this file at the end of all test cases so that if browser is open this will close that

in closebrowser.txt i dont want to execute any test, only tear down the browser(s) after executing all the test.txt file in the folder. Since i can add one or more test file in the folder (e.g. test3.txt,test4.txt...) so instead of providing in these file i want a separate file which will run and close the browser

도움이 되었습니까?

해결책 2

Create __init__.txt file to each of the directories and add

*** Settings ***
Suite teardown    Close all browsers

to the file. That will add suite teardown that will be run after any test suites in the directory. The __init__.txt is called an initialization file

다른 팁

You can't call a Test Case in another Test Case.

You've three way to define TearDown

*** Settings ***
Test Teardown     Close All Browsers
Suite Teardown     Close All Browsers

*** Test Cases ***
My Test
    ...
    [Teardown]    Close All Browsers

Test Teardown and [Teardown] will be executed at the end of a every Test Case inside a Suite, Suite Teardown only at the end of the Suite.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top