Selenium 4 Beginner Tutorial 2 | Web Element Locators | Relative Locators | Step by Step

preview_player
Показать описание
00:00 Introduction
00:59 Web Elements
02:03 How to locate web elements
07:35 Locating single and multiple elements
11:03 Elements Selector Strategies
12:45 Tips on using selectors
15:13 Selenium 4 Relative Locators
20:11 Conclusion

Web Elements:
What are web elements
How to locate web elements in Selenium

Locating single & multiple elements
Locate element using any of its unique properties

Locate multiple elements

for(WebElement element : options) {
}

Elements Selector Strategies
ID : using ID property of the element
Name : using Name property of the element
Link Text : using the visible text value of an anchor element
Partial Link Text : using the partial value of visible text of an anchor element
Class name : using Class name property of the element
Tag name : using Tag name property of the element
CSS Selectors : using a CSS selector with available properties
XPath : using XPath expression with available properties

Tips on using Selectors

ID : use ID if available, unique and consistent

CSS Selectors : If unique ID’s not available

XPath : If CSS Selectors can’t be used

keep your locators as compact and readable as possible
traversing the DOM structure is an expensive operation,
the more you can narrow the scope of your search, the better

Selenium 4 - Relative Locators

The findElement method accepts a new method with(By) which returns a RelativeLocator
above
below
toLeftOf
toRightOf
near

#Selenium4Tutorials

Every LIKE & SUBSCRIPTION gives me great motivation to keep working for you

You can support my mission for education by sharing this knowledge and helping as many people as you can

If my work has helped you, consider helping any animal near you, in any way you can.

Never Stop Learning
Raghav
Рекомендации по теме
Комментарии
Автор

Thanks again Raghav! These tutorials with step by step hands on training are awesome!!

rash
Автор

I love learning selenium 4 this way
Very intresting
Thank you very much

narminetouihri
Автор

Thanks a lot for uploading interesting topics on Selenium 4

jannatulnayeem
Автор

The best series on Selenium I have yet seen!!!

peterluxus
Автор

Thankyou so much raghav, like you explained everything like how to identify element using name locator, and sending some text into identified locator, and how to store and print single and multiple web elements, and about different locators available and tips for using them and for css selectors for I'd we need to use # and class we need to use *, and also you explained about selenium 4 relative locators and types, Thanks raghav really you are sharing really amazing stuff with absolutely no fee and helping people like me . Thanks a ton !

atkuriajaykumar
Автор

Your tech teaching style is really effective. I'm learning so much

Varun-A
Автор

Thanks a lot for starting training on latest version of Selenium. It would be more helpful & thankful if you explain each step for 4.0 version as well like set up & other all topics.

praveenkumar-ofzu
Автор

Great explained 💓After hard work the code is successfully run 😁 Never stop learning 🙂

shahzaibidreesahmed
Автор

Thanks Raghav. Waiting for more video's.

pranali
Автор

Thank you so much raghav for the wonderful session. Can you please share your playlist where we have selenium learning with the demo project? Please share so we can start journey.

deepak
Автор

Thanks for the session Raghav. I am facing issue with Relative Locators - toLeftOf and toRightOf. It returns "NoSuchElementFound" exception. Whereas, the same element works fine with other relative locators. Not finding a solution after debug and how can we fix such kind of issue?

debanjanghosh
Автор

Thank you so much for this video series on selenium, it is very helpful for me. I am also looking for job in software testing in USA. Anyone has any leads on this?

poojamahajan
Автор

thanks Raghav. It's very helpful for me.
BTW, can you show me the tool that used to capture/record the screen?

Thanks so much!!!

HoaiNguyen-tqxm
Автор

Hi RaqHav. i have a question. when i try on my eclipse on sendKeys i get. The method sendKeys(string) is undefined for the type List <WebELement>. I am not sure how to correct this. i have like yours J2SE-1.5. I also downloaded the correct webdriver for Chrome. which is 97.0.4692.71 saved in my eclipse folder.

mxledesma
Автор

at 19.13 the tagname name is added as input where are we getting that?by using id it was not working.

ammuannie
Автор

Hi Raghav!! . This session is a wonderful!! .. ☺
I could see only 2 videos in this playlist (Selenium 4 Beginner Tutorials). Please let me know how can I view the remaining videos in this playlist.

ashafernandes
Автор

Hi, please let me know your eclipse version and java version, I am using java 1.8.0_34 version and java version as 2022-06 version, i am not able run the code for selenium. even i am using updated versions of chrome browser and chrome driver too. please help me for the concern.

pavankumarpullela
Автор

Hi Raghav,
I have a question, if there is no ID, Name and other elements in Element, there is an element class like this class="oxd-button oxd-button--medium oxd-button--main orangehrm-login-button", what should I do?

zuchalaribastian
Автор

How can we write this Relative locator in pagefactory.Could you please help me.Is it possible

madhumalli
Автор

Sir if any one wants to learn automation testing right now, can he/she learn by following your this course or it is needed to learn previous course

saimjahangir
visit shbcf.ru