✔ Intro To New Selenium 4 Features_Part 1 | (Video 148)

preview_player
Показать описание
Intro To New Selenium 4 Features - How To Use Selenium 4

Social Media Contact

► Transcript
Hello and Welcome, in this series, I am going to demo some features that have been added to Selenium 4. All components in the Selenium family have a new feature. Selenium IDE, Selenium WebDriver, and Selenium Grid.

• Selenium IDE is the component that allows us to record and playback our test
• Selenium WebDriver is an API allows us to create and execute our Test Scripts by driving a browser
• Selenium Grid is a way for us to run our test in parallel across more than 1 browser, across more than 1 operating system, and across more than 1 machine

The main reason for upgrading from Selenium 3 to Selenium 4 is the W3C WebDriver Protocol. It’s the new architecture for Selenium. I will discuss new features for the complete Selenium family suite: Selenium WebDriver, Selenium IDE, and Selenium Grid.

For Selenium WebDriver, I am going to explain the new Selenium 4 Architecture - W3C WebDriver Protocol then demo the Relative Locators. Relative Locators is a way to locate an element depending on the position of another element. Next, I will demo how to handle a window by switching to a new window and by switching to a new tab then take a look at getRect. getRect was implemented as a combination of getLocation and getSize. We will also take a screenshot of a WebElement. Last is the Chrome DevTools Protocol which helps us to get the Development Properties.

Although there are 3 components in the Selenium family suite, when we only say Selenium, we are referring to Selenium WebDriver.

Therefore, let’s start with 2 drivers that have an update: ChromeDriver and EdgeDriver. Both drivers now extend ChromiumDriver. Also, both browsers are built on the same Chromium platform.

In Selenium 3, all of the drivers including Chrome and Edge extended the RemoteWebDriver. However, with Selenium 4, FirefoxDriver, InternetExplorerDriver, OperaDriver, and SafariDriver extend RemoteWebDriver. Also, ChromiumDriver extends RemoteWebDriver. RemoteWebDriver is a way to run our test remotely but we have to configure our test.

The benefit of ChromeDriver and EdgeDriver extending ChromiumDriver is access to the getDevTools method. Let me search for getDevTools and we see the DevTools class with getDevTools as the method. This method will allow us to diagnose problems and track what’s going on in the browser.

There’s also a change to 2 methods in the FluentWait class. On the left is Selenium 3 and on the right is Selenium 4. The withTimeout method and pollingEvery method no longer have 2 parameters. We see long duration and TimeUnit unit but it has been replaced with only 1 parameter Duration.

Every FindsBy Interface has been deprecated and removed from Selenium 4. The other FindsBy Interfaces FindsByClassName, FindsByCssSelector, FindsByLinkText, FindsByName, FindsByTagName, and FindsByXPath have also been removed from Selenium 4.

Here’s a webpage that shows more deprecated API’s for Selenium. If we just scroll down, we see some of the methods we already mentioned that‘s been removed from Selenium 4.

Next, are the new features for Selenium IDE.

#Selenium4 #Selenium4WebDriver #Selenium4NewFeatures
Рекомендации по теме
Комментарии
Автор

Nice content! Keep up the great work. I think you'll like my uploads also 😎🤘

johnnyseawright