How to use name locator in selenium?

0 votes
Hello everyone, I am new to Selenium and wanted to know as how to use Name as a Locator?

Thank you in advance.
Dec 21, 2018 in Selenium by Jino
• 5,770 points
74 views

1 answer to this question.

0 votes

You can simply inspect the webpage and see as where is the element and look for the inspect section, you will find the tag name and you can use that accordingly. All you need to keep in mind is that they are not duplicate.

See this :

Use the command as such:

driver.findElement(By.name("q")).sendKeys("Keyword");

Hope this helps.

answered Dec 21, 2018 by Nabarupa

Related Questions In Selenium

0 votes
2 answers

How to use link as a locator to find element in selenium?

driver.findElement(By.linkText("link")).click(); READ MORE

answered Sep 3 in Selenium by Sri
• 2,970 points
298 views
0 votes
1 answer

How to use Actions class in Selenium Webdriver?

In seleniun webdriver it is not mandatory ...READ MORE

answered Apr 4, 2018 in Selenium by Damon Salvatore
• 5,550 points
2,891 views
0 votes
3 answers

How to use JavaScript in selenium to click an Element?

WebElement element = driver.findElement(By.id("id")); JavascriptExe ...READ MORE

answered Aug 31 in Selenium by Sri
• 2,970 points
32,706 views
0 votes
1 answer

How to use Enter/Return Key in Selenium

You can use the below code: import org.openqa.selenium.Keys WebEle ...READ MORE

answered Apr 18, 2018 in Selenium by Meci Matt
• 9,460 points
1,759 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
3,769 views
0 votes
2 answers

Problem while using InternetExplorerDriver in Selenium WebDriver

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

answered Aug 31 in Selenium by Sri
• 2,970 points
4,750 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
2,729 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 in Selenium by Sri
• 2,970 points
3,093 views
+3 votes
1 answer

How to use wait in selenium java?

There are different types of wait you ...READ MORE

answered Dec 18, 2018 in Selenium by Nabarupa
131 views
0 votes
1 answer

How to use css selector in selenium using Java?

Hello @Jino, CSS Selector is pretty easy to ...READ MORE

answered Dec 21, 2018 in Selenium by Nabarupa
279 views