File tree Expand file tree Collapse file tree 3 files changed +20
-6
lines changed Expand file tree Collapse file tree 3 files changed +20
-6
lines changed Original file line number Diff line number Diff line change 11*** Settings ***
22Suite Setup Run Keywords Prefer Custom Keywords Go To Front Page
3- Test Teardown Register Keyword to Run on Failure Nothing
3+ Suite Teardown Run Keywords Set Debug Loglevel Restore Old Search Order
4+ Test Teardown Register Keyword To Run On Failure Nothing
45Resource ../resource.txt
56Library CustomSeleniumKeywords
67
78*** Test Cases ***
89Run On Failure Keyword Only Called Once
910 Set Test Variable ${ON FAIL COUNT} ${0}
10- CustomSeleniumKeywords.Register Keyword To Run On Failure On Fail
11- Selenium2Library.Register Keyword To Run On Failure On Fail
12- Run Keyword And Ignore Error Custom Selenium Keyword id=missing
11+ Register Keyword To Run On Failure On Fail
12+ Run Keyword And Ignore Error Custom Selenium Keyword
1313 Should Be Equal ${ON FAIL COUNT} ${1} On Failure Keyword called ${ON FAIL COUNT} times.
14- [Teardown] Close Browser
14+
15+ *** Variables ***
16+ ${old order}
1517
1618*** Keywords ***
1719On Fail
1820 ${count}= Evaluate ${ON FAIL COUNT} + 1
1921 Set Test Variable ${ON FAIL COUNT} ${count}
2022
2123Prefer Custom Keywords
22- Set Library Search Order CustomSeleniumKeywords
24+ ${old order}= Set Library Search Order CustomSeleniumKeywords
25+
26+ Restore Old Search Order
27+ Set Library Search Order ${old order}
28+
29+ Open Browser To Front Page
30+ Open Browser ${FRONT PAGE}
Original file line number Diff line number Diff line change 11from Selenium2Library import Selenium2Library
22from robot .utils import asserts
3+ from robot .libraries .BuiltIn import BuiltIn
34
45class CustomSeleniumKeywords (Selenium2Library ):
6+
7+ def __init__ (self , * args , ** kwargs ):
8+ ret = super (CustomSeleniumKeywords , self ).__init__ (* args , ** kwargs )
9+ self ._cache = BuiltIn ().get_library_instance ("Selenium2Library" )._cache
10+
511 def custom_selenium_keyword (self ):
612 self .custom_selenium_keyword_inner ()
713
You can’t perform that action at this time.
0 commit comments