File tree Expand file tree Collapse file tree 2 files changed +32
-0
lines changed
src/SeleniumLibraryExtends/FindElements Expand file tree Collapse file tree 2 files changed +32
-0
lines changed Original file line number Diff line number Diff line change 1+ #!/usr/bin/env python
2+ # -*- coding: utf-8 -*-
3+ #
4+ # Copyright (c) 2022 Cléverson Sampaio <cleverson@sampaio.dev.br>
Original file line number Diff line number Diff line change 1+ #!/usr/bin/env python
2+ # -*- coding: utf-8 -*-
3+ #
4+ # Copyright (c) 2022 Cléverson Sampaio <cleverson@sampaio.dev.br>
5+
6+ from robot .libraries .BuiltIn import BuiltIn
7+ from robot .api .deco import keyword
8+ from SeleniumLibraryExtends .report import Report
9+
10+ class FindElements :
11+ def __init__ (self ):
12+ pass
13+
14+ @keyword ("I wait for the ${locator} element to be visible" )
15+ def waitForElementVisible (self , locator : str ):
16+ self .driver = BuiltIn ().get_library_instance ("SeleniumLibrary" )
17+ try :
18+ self .driver .wait_until_element_is_visible (locator )
19+ except Exception as e :
20+ Report ().fail (e )
21+
22+ @keyword ("I wait for the ${locator} element not to be visible" )
23+ def waitForElementNotVisible (self , locator : str ):
24+ self .driver = BuiltIn ().get_library_instance ("SeleniumLibrary" )
25+ try :
26+ self .driver .wait_until_element_is_not_visible (locator )
27+ except Exception as e :
28+ Report ().fail (e )
You can’t perform that action at this time.
0 commit comments