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
10,804 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.

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 19, 2018 by Santhosh

selected Jan 14, 2019 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"));
not working for me in gmail case.

Related Questions In Selenium

0 votes
1 answer

unable to launch my first code in eclipse using selenium chrome driver

@klbret, can you share your code or ...READ MORE

answered Oct 10, 2019 in Selenium by Abha
• 28,140 points
1,334 views
0 votes
1 answer
0 votes
1 answer
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,500 points
2,124 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 28, 2018 in Selenium by nsv999
• 5,500 points
907 views
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,500 points
12,619 views
0 votes
2 answers

Problem while using InternetExplorerDriver in Selenium WebDriver

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

answered Aug 31, 2020 in Selenium by Sri
• 3,190 points
8,572 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,910 points
6,629 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 3, 2020 in Selenium by Sri
• 3,190 points
7,519 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP