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,520 points
13 views

1 answer to this question.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
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
1 answer

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

Hello @Jino, its amazing to explore ways ...READ MORE

answered Dec 21, 2018 in Selenium by Nabarupa
48 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,270 points
1,874 views
0 votes
1 answer

How to use JavaScript in selenium to click an Element?

Executing a click via JavaScript has some ...READ MORE

answered Apr 13, 2018 in Selenium by Shubham
• 12,270 points
7,693 views
0 votes
1 answer

How to use Enter/Return Key in Selenium

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

answered Apr 18, 2018 in Selenium by Meci Matt
• 9,400 points
273 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,030 points
72 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,130 points
444 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,130 points
55 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
40 views
0 votes
1 answer

© 2018 Brain4ce Education Solutions Pvt. Ltd. All rights Reserved.
"PMP®","PMI®", "PMI-ACP®" and "PMBOK®" are registered marks of the Project Management Institute, Inc. MongoDB®, Mongo and the leaf logo are the registered trademarks of MongoDB, Inc.