lib/appium_lib/driver.rb in appium_lib-0.14.0 vs lib/appium_lib/driver.rb in appium_lib-0.15.0
- old
+ new
@@ -550,22 +550,24 @@
# @param post_check [Integer] the amount in seconds to set the
# wait to after checking existance
# @param search_block [Block] the block to call
# @return [Boolean]
def exists pre_check=0, post_check=@default_wait, &search_block
- set_wait pre_check # set wait to zero
-
+ # do not uset set_wait here.
+ # it will cause problems with other methods reading the default_wait of 0
+ # which then gets converted to a 1 second wait.
+ @driver.manage.timeouts.implicit_wait = pre_check
# the element exists unless an error is raised.
exists = true
begin
search_block.call # search for element
rescue
exists = false # error means it's not there
end
# restore wait
- set_wait post_check if post_check != pre_check
+ @driver.manage.timeouts.implicit_wait = post_check if post_check != pre_check
exists
end
# The same as @driver.execute_script
\ No newline at end of file