Selenium 4 Beginner Tutorial 1 | Introduction, Setup & Browser Actions | Step by Step

preview_player
Показать описание
00:00 Introduction
01:35 Selenium 4
03:48 Getting Started - Project Setup
09:31 1st Test
19:30 WebDriverManager
24:33 Browser Actions
25:25 How to open a web page
26:23 Get current URL
27:00 Get Title
27:53 Forward | Back | Refresh
29:44 Switching windows
32:12 Open new Window
33:26 Open new Tab
36:58 Close Browser
38:00 Frames
44:20 Get & Set Window size
48:49 Get & Set Window position
51:44 Maximize | Minimize | Full Screen
53:06 Screenshot
59:04 JavaScript Executor
01:03:58 Conclusion

Selenium 4
--------------
New and improved version of Selenium
Se webdriver can directly communicate with browser using W3C protocol
(without use of json wire protocol as earlier)
New functions added
Multiple windows & tabs management
Relative locators
New Documentation

Getting Started
-------------------
Install Java
Setup Eclipse
Create a new maven project
Add maven dependencies for Selenium 4
Download browser driver & add in a folder in project
(Can also keep at any location on your system and add the location in path env var)
Optional
Add TestNG plugin
Add TestNG dependency

1st Test
---------
Step 1 - Create a class & main method

public static void main(String[] args) {
WebDriver driver = new ChromeDriver();


//close
}

Step 2 - Run code

Using WebDriver Manager

Step 1 - Add maven dependency for webdriver manager -
Step 2 - Add code
Step 3 - To use specific ver of browser

Browser Actions
----------------------
1. Open a web page

2. Get current url

3. Get title

4. Forward | Back | Refresh

5. Switching windows

6. Open new window and switch to the window

7. Open new tab and switch to the tab

8. Closing browser

9. Frames

Locate and Switch

Using id or name

Using index

Return to top level window

10. Window management - Size

Get width & height

Store dimensions & query later

Set window size

10. Window management - Position

Access x and y dimensions individually

Store dimensions & query later

Move the window to the top left of the primary monitor

10. Window management

// maximize window

// minimize window

// fullscreen

11. Screenshots

Take screenshot
File scrFile = ((TakesScreenshot)driver).getScreenshotAs(OutputType.FILE);

Take element screenshot

12. JavaScript

Create JavascriptExecutor interface object by Type casting
JavascriptExecutor js = (JavascriptExecutor)driver;

Get return value from script

JavaScript to click element

Execute JS directly

#Selenium4Tutorials

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

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

What’s New in Selenium 4
* Selenium is now W3C compliant

* Relative Locators

* Better Window/Tab Management

* Improved Selenium Grid

* Upgraded Selenium IDE

* New APIs for CDP (Chrome DevTools Protocol)

* Deprecation of Desired Capabilities

* Modifications in the Actions Class

RaghavPal
Автор

I can not express my gratitude for you..i am totally beginner but with help of your youtube video i learnt lot today. Thanks a lot

factstonotbelieve
Автор

Great video Raghav! Another Gem. My confidence is high again- exactly the review I needed. You are a 🤖 (Machine).

benjaminJohn
Автор

Thank you a lot! I cannot even explain how much you are helping me with my selenium class. My university professor doesn't even explain this clear. 💜

tasha
Автор

Hi Raghav, I recently join your channel and found your selenium series is very useful for all who are looking forward in automation or experienced in Automation. Kindly do post videos as sequence so we can impove our skill by your helping videoes.

shivamvashishth
Автор

You rock, thanks so much! this was very helpful and well organized, you're a great teacher!

k.k
Автор

Thanks for the video. Did not see any notable change in script compared selenium 3. Eagerly waiting for the next part.

sreereshvkm
Автор

Thank you so much for this session, please carry on.

ankitbarnwal
Автор

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

Varun-A
Автор

Very helpful tutorial. Keep up the good work. ✨😀💖

mahodaadikari
Автор

By far very good selenium video, Thanks for your explanation.

atkuriajaykumar
Автор

i love you for who that make this video, it's very very helpfull for me. So amazing !!

heriabdiansaputra
Автор

Awesome tutorial; very easy way to learn; thanks a lot

jannatulnayeem
Автор

Very helpful video and it really helped me move forward by doing a Maven project and adding dependencies than a Java project initially. I like the step by step explanations. Thank you so much Raghav!

rash
Автор

Really superb video lots thanks to you for explanation sharing Knowledge really awesome

sairammadipalli
Автор

Thank you Raghav bro, it really helpful

prasadchavakula
Автор

Woooow amazing video really useful thanks!!!

Vanusez
Автор

Super bro ur videos r helping me alot...Thank u very much

krishnakrishna-zzqx
Автор

There were a lot of changes in the Actions class - Interaction API, hope you will cover them in the 2nd part ❤️

prasanthmohan
Автор

He never disappoints.... thank you again sir

mzamomahaeng