#NEWLINE# @ property #NEWLINE# def performance( self ) : #NEWLINE# #INDENT# if isinstance ( self . _wrapped , WebDriver ) : #NEWLINE# #INDENT# if self . _wrapped . execute_script ( "return 'performance' in window;" ) : #NEWLINE# #INDENT# timeout = ( time . time ( ) + 120 ) #NEWLINE# script = 'return window.performance.timing.loadEventEnd;' #NEWLINE# executor = self . _wrapped . execute_script #NEWLINE# while ( ( time . time ( ) < timeout ) and ( not executor ( script ) ) ) : #NEWLINE# #INDENT# time . sleep ( 0.2 ) #NEWLINE# #UNINDENT# if ( not executor ( script ) ) : #NEWLINE# #INDENT# raise Exception ( 'Timeout!' ) #NEWLINE# #UNINDENT# performance = self . _wrapped . execute_script ( 'return window.performance;' ) #NEWLINE# return Performance ( performance ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# raise AttributeError ( 'This browser is not supporting Timing APIs.' ) #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# raise AttributeError ( "'WebElement' object has not attribute 'performance'" )