c# - How to send a single quote to an input element with Selenium? -


when send single quote sendkeys() method, selenium sends 2 single quotes instead. using c# chrome driver.

here code:

iwebdriver driver = new chromedriver(); var element = driver.findelement(by.id("uid")); element.clear(); element.sendkeys("admin'--"); 

the textbox on tested web page receives following value:

admin''--

how send single quote element?

the code sample sent works me.

i tried firefoxdriver:

iwebdriver driver = new firefoxdriver();         driver.navigate().gotourl("http://www.google.com");         var element = driver.findelement(by.name("q"));         element.clear();         element.sendkeys("one quote: ', double quote \""); 

and output in google search box is:

one quote: ', double quote "

try start simplest example, , insert 1 quote by: "'"


Comments

Popular posts from this blog

c# - Send Image in Json : 400 Bad request -

jquery - Fancybox - apply a function to several elements -

An easy way to program an Android keyboard layout app -