From b7543038e4a6511e47aa05236d814753c94a4a2a Mon Sep 17 00:00:00 2001 From: Edgars Eglitis Date: Tue, 13 Feb 2024 12:19:21 +0200 Subject: [PATCH] fix: fix sendkeys/clear with noraise --- lib/core/device.rb | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) 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