File tree 1 file changed +10
-3
lines changed
lib/appium_lib/ios/element
1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -19,13 +19,18 @@ def alert_click value
19
19
# Get the alert message text.
20
20
# @return [String]
21
21
def alert_text
22
- @driver . switch_to . alert . text
22
+ # this will call get text twice so call bridge directly
23
+ # ".switch_to.alert" calls it once, then ".text" another time.
24
+ # @driver.switch_to.alert.text
25
+ driver . send ( :bridge ) . getAlertText
23
26
end
24
27
25
28
# Accept the alert.
26
29
# @return [void]
27
30
def alert_accept
28
- @driver . switch_to . alert . accept
31
+ # @driver.switch_to.alert.accept
32
+ # ".switch_to.alert" calls getAlertText so use bridge directly
33
+ driver . send ( :bridge ) . acceptAlert
29
34
end
30
35
31
36
# Get the text of the alert's accept button.
@@ -41,7 +46,9 @@ def alert_accept_text
41
46
# Dismiss the alert.
42
47
# @return [void]
43
48
def alert_dismiss
44
- @driver . switch_to . alert . dismiss
49
+ # @driver.switch_to.alert.dismiss
50
+ # ".switch_to.alert" calls getAlertText so use bridge directly
51
+ driver . send ( :bridge ) . dismissAlert
45
52
end
46
53
47
54
# Get the text of the alert's dismiss button.
You can’t perform that action at this time.
0 commit comments