Last updated 21/07/2021
Many of you already know about Selenium. Now the question is, is it really useful when it comes to Automation Testing?
Selenium provides a playback tool for authoring functional tests without the need to learn a test scripting language (Selenium IDE). It also provides a test domain-specific language (Selenese) to write tests in a number of popular programming languages, including C#, Groovy, Java, Perl, PHP, Python, Ruby, and Scala. The tests can then run against most modern web browsers. Selenium runs on Windows, Linux, and macOS. It is open-source software released under the Apache License 2.0.
I hope this answered your question. Didn’t it? For these reasons, Selenium has been the favorite for most organizations. That almost makes you understand how much advantage will you get with all your Selenium skills while applying for a position in a DevOps team. Wonder what kind of questions will be there for you?
Automation testing or Test Automation is a cycle of automating the manual cycle to test the application/framework under test. Automation testing includes the utilization of different testing tools which lets you make test scripts that can be executed over and again and don't need any manual intercession.
The benefits of Automation testing are listed below:
The reasons we should select Selenium as a testing tool are:
Selenium is one of the most mainstream automation testing suites. Selenium is planned in a manner to help and energize automation testing of practical parts of online applications and a wide scope of programs and stages. Because of its reality in the open-source network, it has gotten one of the most acknowledged devices among testing experts.
Selenium isn't only a solitary instrument or a utility, rather a bundle of a few testing devices and for a similar explanation, it is alluded to as a Suite. Every one of these apparatuses is intended to take into account distinctive testing and test climate prerequisites.
The suite bundle comprises the accompanying arrangements of devices:
Selenium supports the following types of testing:
Limitations of Selenium are:
Feature |
Selenium IDE |
Selenium RC |
WebDriver |
Browser Compatibility |
Selenium IDE comes as a Firefox plugin, thus it supports only Firefox |
Selenium RC supports a varied range of versions of Mozilla Firefox, Google Chrome, Internet Explorer and Opera. |
WebDriver supports a varied range of versions of Mozilla Firefox, Google Chrome, Internet Explorer and Opera. Also supports HtmlUnitDriver which is a GUI less or headless browser. |
Record and Playback |
Selenium IDE supports record and playback feature |
Selenium RC doesn't support record and playback features. |
WebDriver doesn't support the record and playback feature |
Server Requirement |
Selenium IDE doesn't require any server to be started before executing the test scripts |
Selenium RC requires the server to be started before executing the test scripts. |
WebDriver doesn't require any server to be started before executing the test scripts |
Architecture |
Selenium IDE is a Javascript-based framework |
Selenium RC is a JavaScript-based Framework. |
WebDriver uses the browser's native compatibility to automation |
Object Oriented |
Selenium IDE is not an object-oriented tool |
Selenium RC is semi object-oriented tool. |
WebDriver is a purely object-oriented tool |
Dynamic Finders (for locating web elements on a webpage) |
Selenium IDE doesn't support dynamic finders |
Selenium RC doesn't support dynamic finders. |
WebDriver supports dynamic finders |
Handling Alerts, Navigations, Dropdowns |
Selenium IDE doesn't explicitly provide aids to handle alerts, navigations, dropdowns |
Selenium RC doesn't explicitly provide aids to handle alerts, navigations, dropdowns. |
WebDriver offers a wide range of utilities and classes that helps in handling alerts, navigations, and dropdowns efficiently and effectively. |
WAP (iPhone/Android) Testing |
Selenium IDE doesn't support testing of iPhone/Andriod applications |
Selenium RC doesn't support testing of iPhone/Android applications. |
WebDriver is designed in a way to efficiently support testing of iPhone/Android applications. The tool comes with a large range of drivers for WAP-based testing. For example, AndroidDriver, iPhone driver |
Listener Support |
Selenium IDE doesn't support listeners |
Selenium RC doesn't support listeners. |
WebDriver supports the implementation of Listeners |
Speed |
Selenium IDE is fast as it is plugged in with the web-browser that launches the test. Thus, the IDE and browser communicates directly |
Selenium RC is slower than WebDriver as it doesn't communicate directly with the browser; rather it sends selenite commands over to Selenium Core which in turn communicates with the browser. |
WebDriver communicates directly with web browsers. Thus making it much faster. |
Selenium IDE is the least complex and most straightforward of the apparent multitude of tools inside the Selenium Package. Its record and playback highlight makes it extraordinarily simple to learn with insignificant colleagues to any programming language. Selenium IDE is an ideal tool for a guileless client.
Selenese is the language that we can use to write test scripts in Selenium IDE.
The locator can be named as an address that recognizes a web component interestingly inside the website page. In this manner, to distinguish web components precisely and correctly we have various sorts of locators in Selenium:
Assert: Assert command checks whether the given condition is true or false. Suppose we affirm whether the given component is available on the site page or not. In the event that the condition is valid, at that point the program control will execute the following test step yet on the off chance that the condition is false, the execution would stop and no further test would be executed.
Verify: Verify command likewise checks whether the given condition is true or false. Regardless of the condition being true or false, the program execution doesn't stop for example, any disappointment during check would not stop the execution and all the test steps would be executed.
XPath is utilized to locate a web component dependent on its XML way. XML represents Extensible Markup Language and is utilized to store, coordinate and transport discretionary information. It stores information in a key-esteem pair which is a lot of like HTML labels. Both being markup dialects and since they fall under a similar umbrella, XPath can be utilized to find HTML components.
The principal behind finding components utilizing XPath is the crossing between different components over the whole page and consequently empowering a client to discover a component with the reference of another component.
Single Slash “/” – Single slash is utilized to make Xpath with an outright way for example the XPath would be made to begin choosing from the document node/start node.
Double Slash “//” – Double Slash is utilized to make Xpath in a relative way for example the XPath would be made to begin selection from a place inside the document.
The issue of the same-origin policy prohibits us to get to the DOM of an archive from inception that is not quite the same as the birthplace we are attempting to get to the report.
The starting point is a successive mix of plan, host, and port of the URL. For instance, for a URL https://www.softwaretestinghelp.com/assets/, the starting point is a mix of http, softwaretestinghelp.com, 80 correspondingly.
Along these lines, the Selenium Core (JavaScript Program) can't get to the components from a cause that is not quite the same as where it was dispatched. For Example, in the event that I have dispatched the JavaScript Program from "https://www.softwaretestinghelp.com", at that point I would have the option to get to the pages inside a similar area, for example, “https://www.softwaretestinghelp.com/resources” or “https://www.softwaretestinghelp.com/istqb-free-updates/”. Different areas like google.com, seleniumhq.org would no more be open.
Along these lines, In a request to deal with the same-origin policy, Selenium Remote Control was presented.
Selenium Grid can be utilized to execute the same or distinctive test scripts on various stages and programs simultaneously in order to accomplish disseminated test execution, testing under various conditions, and sparing execution time astoundingly.
Selenium RC and WebDriver, in a mix, are famously known as Selenium 2. Selenium RC alone is additionally alluded to as Selenium 1.
WebDriver
We can launch the browser with the help of the following syntax:
WebDriver driver = new FirefoxDriver();
WebDriver driver = new ChromeDriver();
WebDriver driver = new InternetExplorerDriver();
Different drivers of WebDriver are:
Two types of waits available in WebDrive are:
Implicit Wait: Implicit waits are utilized to give a default holding up time (say 30 seconds) between each sequential test step/command over the whole test content. Hence, the resulting test step would possibly execute when the 30 seconds have passed in the wake of executing the past test step/command.
Explicit Wait: Explicit waits are utilized to stop the execution till the time a specific condition is met or the most extreme time has passed. Not at all like Implicit waits, explicit waits are applied for a specific occasion as it were.
Wonder where you can learn more about Selenium and end up earning a truckload amount of money? Check out our DevOps courses, maybe you’ll get the one that fits you perfectly!
Topic Related Post
NovelVista Learning Solutions is a professionally managed training organization with specialization in certification courses. The core management team consists of highly qualified professionals with vast industry experience. NovelVista is an Accredited Training Organization (ATO) to conduct all levels of ITIL Courses. We also conduct training on DevOps, AWS Solution Architect associate, Prince2, MSP, CSM, Cloud Computing, Apache Hadoop, Six Sigma, ISO 20000/27000 & Agile Methodologies.
* Your personal details are for internal use only and will remain confidential.
ITIL
Every Weekend |
|
AWS
Every Weekend |
|
DevOps
Every Weekend |
|
PRINCE2
Every Weekend |