Wednesday, August 3, 2022
HomeSoftware TestingAn Overview of Selenide - A Java-Primarily based Automation Framework

An Overview of Selenide – A Java-Primarily based Automation Framework


Have you ever heard of the Selenide take a look at automation framework?

I did not know a lot about it till I spoke with Hima Bindu Peteti about her and her workforce’s expertise utilizing it.

After listening to about all its options, I am stunned extra of us aren’t benefiting from it for concise UI checks automation.

Automation Testing Coaching Programs

INDEX

This is Why Selenide is Cool
Write Much less Automation Code
Out of the Field Able to Go Framework
Selenide within the Actual World
Methods to get began with Automation and Selenide
Selenide Configuration Good for CI Device Like Jenkins
Configuration settings for Selenide
What about assist for Angular and React functions?
Automated Waits
Selenide Check Automation Suggestions

This is Why Selenide is Cool

Selenium (and plenty of different take a look at automation frameworks) require a ton of customized code, and a number of libraries and utilities to get the performance you want.

Hima defined that with Selenide, nonetheless, transferring from a Fast Check Skilled (QTP) to Selenium improved their automation efforts. Over time, although, they seen there was lots of boilerplate code required to create a easy Selenium take a look at.

That is comprehensible since Selenium’s not designed for take a look at automation; Selenium is meant to drive a browser as if it was an actual consumer.

Sure. You could be not directly utilizing it for take a look at automation, however you find yourself writing lots of code to rise up and working.

For instance, in Hima’s group, they’ve ten totally different tasks going on, and every undertaking has a number of scrum groups.

That is problematic.

Write Much less Automation Code

What occurs in the event that they need to code a technique that creates a screenshot if a take a look at fails?

One workforce may create that utility with out realizing whether or not one other workforce has already carried out the identical factor.

Should you scale this downside up, you will discover many of us in the identical firm find yourself writing duplicate utilities only for the sake of automation.

Duplicate code is what prompted Hima’s workforce to create some new, reusable, company-wide utilities for everybody within the firm.

It made good sense since it will assist engineers to start out specializing in the enterprise logic as a substitute of writing additional code.

However as her workforce started creating to arrange utilities, they got here throughout Selenide.

After trying into Selenide, they fell in love with it as a result of it supplied all of the capabilities her workforce was about to attempt to create from scratch.

Automation Testing Flexing Robot

Out of the Field Able to Go Framework

Why write code when you’ll be able to pull in a library that takes care of all of the performance you want out of the field?

It saves a ton of time by serving to to keep away from pointless coding and upkeep.

After researching all the advantages of Selenide, Hima quickly started rolling it out to their different groups.

This freed up extra testers to focus solely on the enterprise logic.

As a result of not lots of code is required utilizing this library to create a take a look at, they ended up writing extra concise code.

Additionally they seen that their script reliability improved as effectively.

FREE TESTGUILD COURSES

How is Selenide working in the true world?

Selenide within the Actual World

Hima believes that with Agile, there should not be a particular position for builders or testers.

Her firm is transferring in the direction of cross-functional roles that everybody has to do all the pieces.

So all of them know what to do and what to implement, they usually have to consider testing on the proper stage and on the proper stage.

The issue, after all, is that, like guide testers, builders typically have a tough time writing Selenium-based automation testing code.

So her workforce affords coaching to the oldsters who’re prepared to study take a look at automation, particularly those that are coming from a guide testing background.

A lot of them can shortly rise up to hurry and begin to choose up small tales slowly.

It has been a multi-year journey for Hima’s firm, and most of her workforce members are doing nice with their automation duties.

For people who find themselves prepared to study Selenide, it is easy to start out creating automated checks.

Let’s Speak!

Methods to get began with Automation and Selenide

You must first perceive somewhat bit about coding practices like object-oriented ideas.

When you’re snug with the object-oriented programming ideas and a number of the Java-related stuff, it is easy to start utilizing Selenide.

Selenide consists of lots of documentation out there on their web site.

You’ll be able to obtain Selenide and get began utilizing their quick-start examples after following these easy steps:

• Create a Maven undertaking
• Import the Selenide library
• As soon as the undertaking is imported, say import Selenide.
• Automate the steps in your take a look at

Selenide Configuration Good for CI Device Like Jenkins

By default, if you’re working Selenium checks and one thing goes fallacious, you’ll want a strategy to see and debug no matter occurred.

One approach could be to make use of a screenshot of the error(s) to indicate the state of the applying throughout the failed take a look at(s).

Should you’re beginning a brand new undertaking with Selenium, you must construct all this stuff into your framework, so that you both want somebody who has glorious design abilities, or somebody that has glorious coding abilities to create customized strategies for you.

However the Selenide library, by default, takes care of this stuff out of the field.

As an example, in the event you’re utilizing Selenide and your take a look at cannot discover a component, a screenshot will routinely seize the problem.

It would additionally save the picture to your goal folder. Logs will even present the anticipated and precise end result(s).

The perfect half is that if something adjustments, like the placement of the screenshots, as an example, it is easy to vary on this framework.

Selenide Code Example

Selenide has one thing known as Configuration.

public class Configuration
extends java.lang.Object

Configuration settings for Selenide

This class is designed so that each setting could be set through both system property or programmatically.

Should you import the configuration class on the setup stage, you’ll get hold of entry to simply set worth for issues like timeouts, and so on.

That is nice as a result of you’ll be able to then ship all of these configuration parameters to Jenkins (or every other CI/CD system).

If, for instance, your screenshot folder must be in a unique location for various groups, you needn’t code this logic.

You’ll be able to simply move the parameter to your CI system at runtime, and will probably be routinely dealt with for you.

Another examples of what you’ll be able to management through the Configurations:

• Which browser to make use of
• Browser window dimension
• Browser model
• Headless
• Proxy data
• Distant data
• Report data
• Screenshots
• Timeouts
• Web page hundreds

What about assist for Angular and React functions?

Generally of us assume that solely Protractor helps angular functions, however that is not true. Instruments like Selenide additionally provide assist for it.

Should you’re solely utilizing Selenium to check an Angular software there, you’ve got in all probability seen a synchronization downside when coping with your system underneath take a look at.

Due to this, many testers use Protractor, which is a JS binding that sits on high of Selenium and was explicitly designed for Angular functions.

This could be fantastic for model new groups engaged on a brand new undertaking, however most teams have already got a fairly sturdy Selenium Java framework.

Should you’re already utilizing Java, you are out of luck with utilizing Protractor together with your current framework. On this case, you need to try Selenide.

Selenide helps Angular, React, and jQuery.

How Selenide works is that it has extra, Angular-specific locators you should utilize. So as a substitute of ready just for ID, Xpath has a strategy to watch for the Angular factor.

Security Testing Tools Robot

Automated Waits

Additionally, by default, each locator you write in Selenide routinely waits for 4 seconds with specific circumstances.

Which means it waits till that exact factor seems on the display screen or within the DOM.

Should you’re coping with Selenium and need to obtain this identical performance, you must import it explicitly, then write code for that anticipated situation.

By default, nonetheless, Selenide handles all of the synchronizations.

And once more—if you must modify that synchronization for a unique wait time relying on the atmosphere, you’ll be able to simply parameterize it and move it a dynamic worth at runtime.

You needn’t fear about altering issues in code.

HIma Selenide

Selenide Check Automation Suggestions

Total, Selenide appears to be like like a really full automation take a look at device framework. If you’re utilizing Java and have to create some automation, you positively ought to give this good software program a attempt.

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments