How to enter password in the password textbox using ID locator in facebook?

0 votes
I am new to selenium and testing the web element of password textbox. I am unable to locate it using the name tag. Can someone help?
Dec 18, 2018 in Selenium by Anjali
• 2,940 points
78 views

1 answer to this question.

0 votes

Here as you can see that the textbox for password is having an ID called pass, we will use this to access the password textbox.

See the code that I used here:

driver.get("https://www.facebook.com");
driver.findElement(By.id("pass")).sendKeys("pa55word");

You can see here that I used Locator ID to find the element i.e. password textbox and I have sent the character sequence i.e. the password. Hope this helps.

answered Dec 18, 2018 by Nabarupa

Related Questions In Selenium

0 votes
1 answer
+4 votes
1 answer
+1 vote
1 answer
0 votes
1 answer

How to scroll the Page up or down in Selenium WebDriver? (using java)

Its pretty simple. Check out the below ...READ MORE

answered Apr 5, 2018 in Selenium by nsv999
• 5,510 points
9,737 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,510 points
1,548 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,850 points
1,487 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,850 points
1,269 views
0 votes
1 answer

How to get the HTML source of a webpage using Selenium in Java?

There is a method called getPageSource() in ...READ MORE

answered Jan 10, 2019 in Selenium by Sneha
2,327 views
+9 votes
15 answers

How to automate gmail login process using selenium webdriver in java?

Check the below code: Here is the working ...READ MORE

answered Apr 24, 2018 in Selenium by Vardy
• 2,370 points
84,659 views