Unable to send keys value inside my password field

0 votes

Hi peeps,

I was trying to go login page for a particular UI

But I was not able to send a value to my password field.

HTML Content:

<input type="password" class="editbox" name="airstation_pass" placeholder="Enter the password." value="" data-fn="this.focus()" onfocus="dispElem('help_pass', '', this);" onblur="dispElem('help_pass', 'none', this);" onmouseover="dispElem('help_pass', '', this);" onmouseout="dispElem('help_pass', 'none', this);" xpath="1">

python Code:

password = driver.find_elements_by_name("airstation_pass")

# password.clear()
if password.is_displayed():
    password.click()
    password.clear()
    password.send_keys("password")

Error :

Traceback (most recent call last):
  File "/home/Documents/test_samples/Buffalo_ap.py", line 19, in <module>
    password.click()
AttributeError: 'list' object has no attribute 'click'
[Finished in 34.9s with exit code 1]

Dec 18, 2018 in Selenium by Santhosh
• 190 points
274 views
@Santhosh I guess that the password field is a textbox and not a button so try using the code without password.click()

1 answer to this question.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
0 votes
Best answer
Hey thanks for the input..
I found the answer if type= password you have to use the below command to execute it.

Driver.fine_element_by_css_selector("input[type=password").sendkeys("password")
answered Dec 18, 2018 by Santhosh

selected Jan 14 by Santhosh

Hey @Santhosh, glad you got the answer but again this is what i tried on facebook and it works fine for me.

I wrote the code in Java:

driver.get("https://www.facebook.com");
driver.findElement(By.id("email")).sendKeys("myemail@gmail.com");
driver.findElement(By.id("pass")).sendKeys("Pa55word");

I tried the same for Gmail and it also worked absolutely fine:

driver.get("https://www.gmail.com");
driver.findElement(By.id("identifierId")).sendKeys("priyaj");
WebElement password = driver.findElement(By.name("password"));

Related Questions In Selenium

0 votes
1 answer
0 votes
1 answer

Unable to connect to chromedriver 127.0.0.1:9515 on Amazon Linux AMI server

The issue seems to be only with ...READ MORE

answered Mar 26, 2018 in Selenium by nsv999
• 5,050 points
454 views
0 votes
1 answer

Not able to use “explicit wait” in my code

To wait until the entire data has ...READ MORE

answered Mar 27, 2018 in Selenium by nsv999
• 5,050 points
56 views
0 votes
1 answer

Unable to switch back to default frame

That's because you should switch back to ...READ MORE

answered Mar 29, 2018 in Selenium by nsv999
• 5,050 points
58 views
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,140 points
5,165 views
0 votes
1 answer

Unable to use Selenium IDE & Firebug on Firefox

Unfortunately, Selenium IDE will not work anymore ...READ MORE

answered Apr 9, 2018 in Selenium by nsv999
• 5,050 points
65 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
142 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
531 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
134 views

© 2018 Brain4ce Education Solutions Pvt. Ltd. All rights Reserved.
"PMP®","PMI®", "PMI-ACP®" and "PMBOK®" are registered marks of the Project Management Institute, Inc. MongoDB®, Mongo and the leaf logo are the registered trademarks of MongoDB, Inc.