File tree Expand file tree Collapse file tree 1 file changed +18
-2
lines changed Expand file tree Collapse file tree 1 file changed +18
-2
lines changed Original file line number Diff line number Diff line change @@ -30,7 +30,9 @@ def __call__(self, xpath: str) -> '_XMLElement':
30
30
raw_bounds : str = node .attrib .get ("bounds" ) # [832,1282][1125,1412]
31
31
bounds : Bounds = parse_bounds (raw_bounds )
32
32
logger .debug (f"{ xpath } Bounds: { bounds } " )
33
- return _XMLElement (bounds , self ._d )
33
+ _xe = _XMLElement (bounds , self ._d )
34
+ setattr (_xe , "attrib_info" , node .attrib )
35
+ return _xe
34
36
35
37
return _XMLElement (None , self ._d )
36
38
@@ -102,4 +104,18 @@ def long_click(self):
102
104
@delay
103
105
def input_text (self , text ):
104
106
self .click ()
105
- self ._d .input_text (text )
107
+ self ._d .input_text (text )
108
+
109
+ @property
110
+ @delay
111
+ def info (self ) -> dict :
112
+ if hasattr (self , 'attrib_info' ):
113
+ return getattr (self , 'attrib_info' )
114
+ else :
115
+ logger .warning ("the attribute <attrib_info> does not exists!" )
116
+ return {}
117
+
118
+ @property
119
+ @delay
120
+ def text (self ) -> str :
121
+ return self .info .get ("text" )
You can’t perform that action at this time.
0 commit comments