filmov
tv
Selenium 4 Beginner Tutorial 1 | Introduction, Setup & Browser Actions | Step by Step
Показать описание
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
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
Комментарии