File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed
src/SeleniumLibraryExtends Expand file tree Collapse file tree 1 file changed +23
-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>
5+
6+ from robot .libraries .BuiltIn import BuiltIn
7+
8+ class Highlight :
9+ def __init__ (self ):
10+ pass
11+
12+ def init (self , locator : str ):
13+ self .driver = BuiltIn ().get_library_instance ('SeleniumLibrary' )
14+ element = self .driver .find_element (locator )
15+ if element :
16+ script = """
17+ original_style = arguments[0].getAttribute('style');
18+ arguments[0].setAttribute('style', original_style + ";box-shadow: inset 0 0 0 2px red;");
19+ setTimeout(function(){
20+ arguments[0].setAttribute('style', original_style);
21+ }, 500);
22+ """
23+ self .driver .driver .execute_script (script , element )
You can’t perform that action at this time.
0 commit comments