And for the clarification... I expect that the result is,

OK: password, merlyn and merlyn match.

On Friday, March 13, 2015 at 3:47:25 PM UTC+8, Ping-0t wrote:
>
> Hello Guys,
>
> I am having trouble with my test scripts... my if else doesn't working 
> properly.. Can anyone help me with this.. 
>
> Here is my codes:
> (1..2).each do |i|
>       @browser.text_field(:id, $user_account_fields[i]).set($to_input[i])
>       if $to_input[1] == $to_input[2]
>            puts "PASSWORD MATCH"
>            if @browser.text_field(:id => $user_account_fields[i], 
> :aria_invalid 
> => "false").exists?
>                puts "OK: #{$user_account_fields[i]}, #{$to_input[1]} and 
> #{$to_input[2]} match."
>            else
>                puts "NG: #{$user_account_fields[i]}, #{$to_input[1]} and 
> #{$to_input[2]} match. Should be accepted."
>            end
>       else
>           puts "PASSWORD MISMATCH"
>           if @browser.text_field(:id => $user_account_fields[i], 
> :aria_invalid 
> => "false").exists?
>               puts "OK: #{$user_account_fields[i]}, #{$to_input[1]} and 
> #{$to_input[2]} match."
>           else
>               puts "NG: #{$user_account_fields[i]}, #{$to_input[1]} and 
> #{$to_input[2]} match. Should be accepted."
>           end
>       end
>   end
>
>
> And this is what i've got from my GitBash:
> User1@DOCUMENTATIONS /c/testing/users
> $ ruby user_add.rb
> Loaded suite user_add
> Started
> SUCCESS: anne is a valid username
> PASSWORD MATCH
> NG: password, merlyn and merlyn match. Should be accepted.
> PASSWORD MATCH
> NG: password_confirm, merlyn and merlyn match. Should be accepted.
> .
>
> Finished in 102.03095 seconds.
>
> --------------------------------------------------------------------------------
>
> 1 tests, 0 assertions, 0 failures, 0 errors, 0 pendings, 0 omissions, 0 
> notifica
> tions
> 100% passed
>
> --------------------------------------------------------------------------------
>
> 0.01 tests/s, 0.00 assertions/s
>
> Any help is really appreciated. thanks! :)
>
> Regards,
>
> Ping
>
>

-- 
-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

[email protected]
http://groups.google.com/group/watir-general
[email protected]

--- 
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to