I want to type the ampersand "&" key in the text-box with selenium web-driver. But selenium-2 looses its focus from type-box while typing the ampersand. My command is, self.type("&", :update => true)
I know that in selenium, keys are sent in UTF_8 format and I have tried to send the equivalent of ampersand but the behavior is still same (as expected). I know XML or HTML supports ampersand with some special escape characters. I want to know is there a way to replace the ampersand with some escape sequence like (HTML code) "&" or "&" in send_keys or type_keys command?
OR is there any other way to type the ampersand "&" in the text-box with selenium-2?
Please let me know your suggestion.
thanks, Sri
I spent hours on this over multiple days, and eventually @Asaph told me "temporarily remove all of your javascript and see if that is what is causing the ampersand to blank out." He was correct. Now $searchBox->send_keys("bath & body");
works fine.
I eventually narrowed it down to one part of Jquery-ui Autocomplete that was interfering. This property:
source:function( request, response ) { //implementation removed }
All other javascript could remain in place and work fine. I now want to figure out why Jquery-ui > Autocomplete > Source conflicted with WebDriver and see whether there is a workaround.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With