@@ -1804,27 +1804,27 @@ def open_html_file(self, html_file):
1804
1804
file_path = abs_path + "/%s" % html_file
1805
1805
self .open ("file://" + file_path )
1806
1806
1807
- def execute_script (self , script ):
1807
+ def execute_script (self , script , * args , ** kwargs ):
1808
1808
self .__check_scope ()
1809
- return self .driver .execute_script (script )
1809
+ return self .driver .execute_script (script , * args , ** kwargs )
1810
1810
1811
1811
def execute_async_script (self , script , timeout = None ):
1812
1812
self .__check_scope ()
1813
1813
if not timeout :
1814
1814
timeout = settings .EXTREME_TIMEOUT
1815
1815
return js_utils .execute_async_script (self .driver , script , timeout )
1816
1816
1817
- def safe_execute_script (self , script ):
1817
+ def safe_execute_script (self , script , * args , ** kwargs ):
1818
1818
""" When executing a script that contains a jQuery command,
1819
1819
it's important that the jQuery library has been loaded first.
1820
1820
This method will load jQuery if it wasn't already loaded. """
1821
1821
self .__check_scope ()
1822
1822
try :
1823
- return self .execute_script (script )
1823
+ return self .driver . execute_script (script , * args , ** kwargs )
1824
1824
except Exception :
1825
1825
# The likely reason this fails is because: "jQuery is not defined"
1826
1826
self .activate_jquery () # It's a good thing we can define it here
1827
- return self .execute_script (script )
1827
+ return self .driver . execute_script (script , * args , ** kwargs )
1828
1828
1829
1829
def set_window_rect (self , x , y , width , height ):
1830
1830
self .__check_scope ()
0 commit comments