Cannot use sendkeys to input string on an element in selenium

0 votes
I am trying to find a input box and then using sendkeys to send an input to the input box but I am unable to do this. It gives me an error saying cannot find the element. Please help.
Jan 4, 2019 in Selenium by Jino
• 5,770 points
240 views

1 answer to this question.

0 votes

The problem may be of the locator that you are using.

Just change the locator to By.xpath like this:

WebElement InputField = driver.findElement(By.xpath("//input[@type='search'"));
passwordInputField.sendKeys("Your string");

Hope this helps you!

answered Jan 4, 2019 by Dushyant

Related Questions In Selenium

0 votes
2 answers

Unable to Click on an Element in Selenium (Python) even after finding it.

Here, I give you working script which ...READ MORE

answered Sep 19, 2018 in Selenium by Priyaj
• 57,640 points
16,188 views
0 votes
3 answers

How to use JavaScript in selenium to click an Element?

WebElement element = driver.findElement(By.id("id")); JavascriptExe ...READ MORE

answered Aug 31 in Selenium by Sri
• 2,970 points
30,780 views
0 votes
0 answers
0 votes
2 answers

Finding WebDriver element with Class Name in java

The better way to handle this element ...READ MORE

answered Apr 10, 2018 in Selenium by nsv999
• 5,510 points
3,499 views
0 votes
2 answers

Problem while using InternetExplorerDriver in Selenium WebDriver

enable trusted connection  in internet explorer by ...READ MORE

answered Aug 31 in Selenium by Sri
• 2,970 points
4,505 views
0 votes
1 answer

Geo-location microphone camera pop up

To Allow or Block the notification, access using Selenium and you have to ...READ MORE

answered May 11, 2018 in Selenium by Samarpit
• 5,890 points
2,582 views
0 votes
2 answers

How to use such xpath to find web elements

xpath are two types. 1) Absolute XPath:    /html/b ...READ MORE

answered Sep 2 in Selenium by Sri
• 2,970 points
2,824 views
0 votes
2 answers

How to use link as a locator to find element in selenium?

driver.findElement(By.linkText("link")).click(); READ MORE

answered Sep 3 in Selenium by Sri
• 2,970 points
277 views
0 votes
1 answer