Reputation: 1865
*** 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
Upvotes: 1
Views: 9299
Reputation: 876
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
Upvotes: 0
Reputation: 825
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.
Upvotes: 1