File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -30,7 +30,9 @@ def __call__(self, xpath: str) -> '_XMLElement':
3030 raw_bounds : str = node .attrib .get ("bounds" ) # [832,1282][1125,1412]
3131 bounds : Bounds = parse_bounds (raw_bounds )
3232 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
3436
3537 return _XMLElement (None , self ._d )
3638
@@ -102,4 +104,18 @@ def long_click(self):
102104 @delay
103105 def input_text (self , text ):
104106 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