-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
EES-4117 - slight change to refetching selenium elements behaviour to…
… make it a bit clearer as to why we need to reinitialise the selenium elements prior to each test run
- Loading branch information
1 parent
5d36371
commit 2085598
Showing
2 changed files
with
29 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,34 @@ | ||
from robot.libraries.BuiltIn import BuiltIn | ||
from SeleniumLibrary.keywords.waiting import WaitingKeywords | ||
|
||
sl_instance = None | ||
element_finder_instance = None | ||
waiting_instance = None | ||
|
||
|
||
def sl(): | ||
return BuiltIn().get_library_instance("SeleniumLibrary") | ||
global sl_instance | ||
if sl_instance is None: | ||
sl_instance = BuiltIn().get_library_instance("SeleniumLibrary") | ||
return sl_instance | ||
|
||
|
||
def element_finder(): | ||
return sl()._element_finder | ||
global element_finder_instance | ||
if element_finder_instance is None: | ||
element_finder_instance = sl()._element_finder | ||
return element_finder_instance | ||
|
||
|
||
def waiting(): | ||
return WaitingKeywords(sl()) | ||
global waiting_instance | ||
if waiting_instance is None: | ||
waiting_instance = WaitingKeywords(sl()) | ||
return waiting_instance | ||
|
||
|
||
def clear_instances(): | ||
global sl_instance, element_finder_instance, waiting_instance | ||
sl_instance = None | ||
element_finder_instance = None | ||
waiting_instance = None |