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,950 points
1,857 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
2 answers

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

JavascriptExecutor jsx = (JavascriptExecutor)driver; jsx.executeScript("window.scrollBy(0,555)", ""); or Action classes ...READ MORE

answered Sep 6, 2020 in Selenium by Sri
• 3,190 points
18,923 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
13,686 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
9,149 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
7,228 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,880 views
+1 vote
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 11, 2019 in Selenium by Sneha
29,493 views
+10 votes
17 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,360 points
198,017 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