Click_no_wait

hi,

When I use click_no_wait function as shown below,

begin
$browser.buttons[1].click_no_wait
rescue =>e
puts e.message
end

It throws this following error

“undefined method `join’ for nil:NilClass”

Can anyone please guide me why this error happens and How could I
resolve this problem?

Can you show the full trace and the line of code in the source file at
the end of the chain?

Can anyone please guide me why this error happens and How could
I resolve this problem?

This happens because you have a .nil object.

Btw you show that you call .join method in the error, but
your code does not have a .join method. So you don’t give
us the required information.

hi Joel P. and Robert H.,

Thanks,It’s working fine for me now, I just changed the code as below,

begin
$browser.button(:class,‘something’).click_no_wait
rescue =>e
puts e.message
end

Presumably there was only 1 button then, meaning that an index of “1”
returned nil to the next method.

hi joel,

“Presumably there was only 1 button then, meaning that an index of “1”
returned nil to the next method.”

No, there are two buttons, I tried using .click function, it did not
fail to click that button.