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
378 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 5, 2020 in Selenium by Sri
• 3,010 points
14,772 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,520 points
4,888 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,010 points
5,695 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,890 points
3,475 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 2, 2020 in Selenium by Sri
• 3,010 points
4,167 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 10, 2019 in Selenium by Sneha
17,122 views
+11 votes
16 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
136,240 views