Selenium WebDriver Tutorial #12 - What are Locators in Selenium WebDriver

  Рет қаралды 83,242

Software Testing Mentor

Software Testing Mentor

Күн бұрын

Пікірлер: 23
@manoj_mafiosi
@manoj_mafiosi Жыл бұрын
Selenium WebDriver Tutorial #12 - Locators in Selenium - Notes 1. Introduction: - Locators play a vital role in identifying elements on a web page in Selenium WebDriver. - They are essential for writing effective test cases in Selenium automation. 2. Web Elements: - Web elements are elements present on a web page, such as text fields, buttons, and links. - Manual testing involves identifying and interacting with these elements. 3. Basic Locator Strategies: - Selenium provides eight basic locator strategies to identify web elements: - ID: Locate elements by their unique ID attribute using "By.id." - Name: Locate elements by their name attribute using "By.name." - Class Name: Locate elements by their class attribute using "By.className." - CSS Selector: Locate elements using CSS selectors with "By.cssSelector." - XPath: Advanced locator using XPath expressions with "By.xpath." - Link Text: Locate anchor elements (links) based on their visible text with "By.linkText." - Partial Link Text: Locate anchor elements using partial matching of their visible text with "By.partialLinkText." - Tag Name: Locate elements by their HTML tag name using "By.tagName." 4. Using Locators: - To use locators, we can use the "findElement" method provided by WebDriver. - Example: To locate an element by ID, use "driver.findElement(By.id("elementID"))." 5. Ensuring Unique Locators: - Chosen locators must be unique and reliably identify the correct element on the page. - If one locator doesn't work, try other locators until finding the most suitable one. 6. Selenium 4 Update: - Selenium 4 introduces relative locators (previously called friendly locators), which will be covered in the next tutorial. 7. Advanced Locator Strategies: - For handling dynamic web elements and more advanced strategies, refer to separate tutorials on XPath and CSS selector. 8. Conclusion: - Locators are crucial for identifying web elements in Selenium WebDriver. - Understanding and using various locator strategies enhances test case effectiveness. - Selenium 4 introduces relative locators for further improvements. - Refer to additional tutorials for handling dynamic elements using XPath and CSS selector.
@bolexi7902
@bolexi7902 2 жыл бұрын
These selenium tutorials are second to none, well explained. Everything right on point. Thanks a lot.
@shubhamsharma8378
@shubhamsharma8378 3 жыл бұрын
Hey Teach, I was searching for Selenium Tutorial and After searching on KZbin I found your Tutorial. And I loved this Tutorial. Thankyou So Much.
@rishabhsingh6168
@rishabhsingh6168 3 жыл бұрын
Thanks bro for making such wonder ful series had a great experience so far.
@PoonamShinde-zn5fn
@PoonamShinde-zn5fn Жыл бұрын
Great Explanation with the latest Selenium version. Thanks
@softwaretestingmentor
@softwaretestingmentor Жыл бұрын
You're welcome! Keep watching for more videos and tutorials.
@darshanavekariya5548
@darshanavekariya5548 Жыл бұрын
What an amazing tutorial for beginners, Thank you sir.
@softwaretestingmentor
@softwaretestingmentor Жыл бұрын
You're very welcome! Keep watching for more videos and tutorials.
@salonisharma7632
@salonisharma7632 3 жыл бұрын
Thank you so much sir. These tutorials are really very helpful and well structured.
@softwaretestingmentor
@softwaretestingmentor 3 жыл бұрын
Glad you like them!
@priyaroy6005
@priyaroy6005 2 жыл бұрын
@@softwaretestingmentor hlo sir The method click() is undefined for the type By. Why this error is showing. Please help me sir . I am not able to figure out the error.
@srinivaspatel2567
@srinivaspatel2567 3 жыл бұрын
thank you so much sir and u r really great sir
@samBobo208
@samBobo208 9 ай бұрын
Hi I am following your tutorial and so far it's been amazing! I just need some help. My code is running and the browser does close after execution but on my console I don't see any information example 'Chrome started successfully' etc. I tried a print statement and it works fine. Any Idea what's wrong?
@ganapathisubramanyamjayam
@ganapathisubramanyamjayam 3 жыл бұрын
great tutorial! but I actually have a small problem. I am trying to use selenium to test a jsp page and I am not able to find any elements there. I have tried finding by name, id and xpath but nothing worked. can I get some help with this please.
@sudhamshakula128
@sudhamshakula128 3 жыл бұрын
Yeah I had the same problem
@moonsharmin8774
@moonsharmin8774 2 жыл бұрын
hello sir , i am a beginner here. can explain me why you use hyphen between username ?
@shubhangisuryavanshi5860
@shubhangisuryavanshi5860 3 жыл бұрын
Sir its not going to Quick tour page when I have typed the command.
@gunaseelanponnuvel3180
@gunaseelanponnuvel3180 3 жыл бұрын
Sir please tell the priority of Locators in Selenium
@vanitageorge8634
@vanitageorge8634 9 ай бұрын
How to get in touch with you?
@priyaroy6005
@priyaroy6005 2 жыл бұрын
The method Click() is undefined for the type By . Why this error is showing . Please help.
@dsc_dsc
@dsc_dsc 2 жыл бұрын
I hope it's not too late, but you're doing the same mistake as 16:37. Click is a method of findElement, not By. Watch that he add an ) and it solved it.
@soundaryaleharichunduri8565
@soundaryaleharichunduri8565 3 жыл бұрын
sir ihave done samebut driver.get norworking getting main threadexceptionerror
@Bell4Fun
@Bell4Fun 2 жыл бұрын
why dataset attribute us not used
Selenium WebDriver Tutorial #13 - What is Relative Locator in Selenium
15:27
Software Testing Mentor
Рет қаралды 60 М.
Selenium WebDriver Tutorial #10 - How to Write First TestCase in Selenium
15:42
Software Testing Mentor
Рет қаралды 199 М.
ТЮРЕМЩИК В БОКСЕ! #shorts
00:58
HARD_MMA
Рет қаралды 2,7 МЛН
Муж внезапно вернулся домой @Oscar_elteacher
00:43
История одного вокалиста
Рет қаралды 7 МЛН
Из какого города смотришь? 😃
00:34
МЯТНАЯ ФАНТА
Рет қаралды 2,6 МЛН
Selenium WebDriver Tutorial #11 - Understand WebDriver Interface
21:49
Software Testing Mentor
Рет қаралды 95 М.
Locators In Selenium Webdriver- Which locator in Best for Automation?
28:08
Selenium WebDriver Tutorial #24 - How to Handle Alert Popup in Selenium
16:20
Software Testing Mentor
Рет қаралды 31 М.
Selenium WebDriver Tutorial #16 - WebElement Methods in Selenium
18:52
Software Testing Mentor
Рет қаралды 43 М.
Selenium WebDriver Tutorial #25 - How to Handle Multiple Windows in Selenium
20:29
Software Testing Mentor
Рет қаралды 56 М.
Selenium WebDriver Tutorial #8 - How to Manage Dependencies with Maven
15:01
Software Testing Mentor
Рет қаралды 126 М.
Locators in Selenium WebDriver | Ultimate Guide for Beginners |  Day 10
18:13
The Testing Academy
Рет қаралды 12 М.
Different Locators In Selenium WebDriver || Best locator to use
44:28
Naveen AutomationLabs
Рет қаралды 130 М.