File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -29,7 +29,9 @@ def __call__(self, xpath: str) -> '_XMLElement':
2929 raw_bounds : str = node .attrib .get ("bounds" ) # [832,1282][1125,1412]
3030 bounds : Bounds = parse_bounds (raw_bounds )
3131 logger .debug (f"{ xpath } Bounds: { bounds } " )
32- return _XMLElement (bounds , self ._d )
32+ _xe = _XMLElement (bounds , self ._d )
33+ setattr (_xe , "attrib_info" , node .attrib )
34+ return _xe
3335
3436 return _XMLElement (None , self ._d )
3537
@@ -90,4 +92,18 @@ def long_click(self):
9092 @delay
9193 def input_text (self , text ):
9294 self .click ()
93- self ._d .input_text (text )
95+ self ._d .input_text (text )
96+
97+ @property
98+ @delay
99+ def info (self ) -> dict :
100+ if hasattr (self , 'attrib_info' ):
101+ return getattr (self , 'attrib_info' )
102+ else :
103+ logger .warning ("the attribute <attrib_info> does not exists!" )
104+ return {}
105+
106+ @property
107+ @delay
108+ def text (self ) -> str :
109+ return self .info .get ("text" )
You can’t perform that action at this time.
0 commit comments