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 in Selenium by Jino
• 5,550 points
74 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 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
• 56,160 points
5,977 views
0 votes
1 answer

How to use JavaScript in selenium to click an Element?

Executing a click via JavaScript has some ...READ MORE

answered Apr 13, 2018 in Selenium by Shubham
• 13,190 points
9,846 views
0 votes
1 answer

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,050 points
259 views
0 votes
1 answer
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,130 points
629 views
0 votes
1 answer

How to use such xpath to find web elements

It's much simpler to use: #MyDiv123 > div.super or ...READ MORE

answered Jun 14, 2018 in Selenium by Samarpit
• 5,130 points
257 views
0 votes
1 answer

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

Hello @Jino, its amazing to explore ways ...READ MORE

answered Dec 21, 2018 in Selenium by Nabarupa
68 views
0 votes
1 answer

How to use webdriver in selenium?

In Java, in order to call the ...READ MORE

answered Dec 20, 2018 in Selenium by Shuvodip
64 views