Selenium Webdriver using Java - sendkeys with double slash
问题 I'm using Selenium WebDriver with Java. I'm trying to enter the text 'test' followed by 2 backslashes into a text field. When I tried the following code - driver.findElement(By.id("txtEditExcludeRegPath")).sendKeys("test\"); Only test\ is entered into the textbox. The remaining backslash is left out. Can someone help me solve this problem. Please note - Even in this post, I'm unable to view 2 consecutive slashes after 'test'. Only 1 \ gets posted. 回答1: Try the code like this ( Assuming you