@@ -5014,11 +5014,11 @@ def js_click(
5014
5014
if ":contains\\(" not in css_selector:
5015
5015
tag_name = self.execute_script(
5016
5016
"return document.querySelector('%s').tagName.toLowerCase()"
5017
- % css_selector
5017
+ ";" % css_selector
5018
5018
)
5019
5019
if tag_name == "a":
5020
5020
href = self.execute_script(
5021
- "return document.querySelector('%s').href" % css_selector
5021
+ "return document.querySelector('%s').href; " % css_selector
5022
5022
)
5023
5023
origin = self.get_origin()
5024
5024
href_origin = [href, origin]
@@ -6743,12 +6743,12 @@ def __get_shadow_element(
6743
6743
# When Firefox adds support, switch to element.shadow_root
6744
6744
try:
6745
6745
shadow_root = self.execute_script(
6746
- "return arguments[0].shadowRoot", element
6746
+ "return arguments[0].shadowRoot; ", element
6747
6747
)
6748
6748
except Exception:
6749
6749
time.sleep(2)
6750
6750
shadow_root = self.execute_script(
6751
- "return arguments[0].shadowRoot", element
6751
+ "return arguments[0].shadowRoot; ", element
6752
6752
)
6753
6753
if timeout == 0.1 and not shadow_root:
6754
6754
raise Exception(
@@ -6757,7 +6757,7 @@ def __get_shadow_element(
6757
6757
elif not shadow_root:
6758
6758
time.sleep(2) # Wait two seconds for the shadow root to appear
6759
6759
shadow_root = self.execute_script(
6760
- "return arguments[0].shadowRoot", element
6760
+ "return arguments[0].shadowRoot; ", element
6761
6761
)
6762
6762
if not shadow_root:
6763
6763
raise Exception(
@@ -9490,15 +9490,15 @@ def get_jqc_button_input(self, message, buttons, options=None):
9490
9490
waiting_for_response = True
9491
9491
while waiting_for_response:
9492
9492
time.sleep(0.05)
9493
- jqc_open = self.execute_script("return jconfirm.instances.length")
9493
+ jqc_open = self.execute_script("return jconfirm.instances.length; ")
9494
9494
if str(jqc_open) == "0":
9495
9495
break
9496
9496
time.sleep(0.1)
9497
9497
status = None
9498
9498
try:
9499
- status = self.execute_script("return $jqc_status")
9499
+ status = self.execute_script("return $jqc_status; ")
9500
9500
except Exception:
9501
- status = self.execute_script("return jconfirm.lastButtonText")
9501
+ status = self.execute_script("return jconfirm.lastButtonText; ")
9502
9502
return status
9503
9503
9504
9504
def get_jqc_text_input(self, message, button=None, options=None):
@@ -9573,15 +9573,15 @@ def get_jqc_text_input(self, message, button=None, options=None):
9573
9573
waiting_for_response = True
9574
9574
while waiting_for_response:
9575
9575
time.sleep(0.05)
9576
- jqc_open = self.execute_script("return jconfirm.instances.length")
9576
+ jqc_open = self.execute_script("return jconfirm.instances.length; ")
9577
9577
if str(jqc_open) == "0":
9578
9578
break
9579
9579
time.sleep(0.1)
9580
9580
status = None
9581
9581
try:
9582
- status = self.execute_script("return $jqc_input")
9582
+ status = self.execute_script("return $jqc_input; ")
9583
9583
except Exception:
9584
- status = self.execute_script("return jconfirm.lastInputText")
9584
+ status = self.execute_script("return jconfirm.lastInputText; ")
9585
9585
return status
9586
9586
9587
9587
def get_jqc_form_inputs(self, message, buttons, options=None):
@@ -9644,19 +9644,19 @@ def get_jqc_form_inputs(self, message, buttons, options=None):
9644
9644
waiting_for_response = True
9645
9645
while waiting_for_response:
9646
9646
time.sleep(0.05)
9647
- jqc_open = self.execute_script("return jconfirm.instances.length")
9647
+ jqc_open = self.execute_script("return jconfirm.instances.length; ")
9648
9648
if str(jqc_open) == "0":
9649
9649
break
9650
9650
time.sleep(0.1)
9651
9651
text_status = None
9652
9652
button_status = None
9653
9653
try:
9654
- text_status = self.execute_script("return $jqc_input")
9655
- button_status = self.execute_script("return $jqc_status")
9654
+ text_status = self.execute_script("return $jqc_input; ")
9655
+ button_status = self.execute_script("return $jqc_status; ")
9656
9656
except Exception:
9657
- text_status = self.execute_script("return jconfirm.lastInputText")
9657
+ text_status = self.execute_script("return jconfirm.lastInputText; ")
9658
9658
button_status = self.execute_script(
9659
- "return jconfirm.lastButtonText"
9659
+ "return jconfirm.lastButtonText; "
9660
9660
)
9661
9661
return (text_status, button_status)
9662
9662
0 commit comments