diff --git a/lib/core/device.rb b/lib/core/device.rb index 38b70964..530d4b4e 100644 --- a/lib/core/device.rb +++ b/lib/core/device.rb @@ -575,7 +575,10 @@ def send_keys(action) value = value.gsub("$AND_ROLE$", @role) if value && value.is_a?(String) && value.include?("$AND_ROLE$") log_info("#{@role}: Sending keys: #{value}") - el = wait_for(action) if (!action["Actions"] && action["Strategy"]) + if !action["Actions"] && action["Strategy"] + el = wait_for(action) + return unless el + end start = Time.now error = nil @@ -617,7 +620,10 @@ def send_keys(action) # Id def clear_field(action) el = nil - el = wait_for(action) if (!action["Actions"] && action["Strategy"]) + if !action["Actions"] && action["Strategy"] + el = wait_for(action) + return unless el + end start = Time.now error = nil while (Time.now - start) < @timeout