Transcripted Summary

If you head over to the Selenium IDE website. You'll end up on the landing page for the project.

At the top of the page, there are buttons to install Chrome, and to install Firefox. Selenium IDE currently is a browser extension that's available in both Chrome and Firefox. If you click the link, it'll open up a new tab, and take you here for Chrome, and the same for Firefox.

Let's step through installing the extension for either browser, and then step through a simple "Hello, World," example.

First just click “add to Chrome”. And then when it prompts you, “click add extension”. And after a few seconds it will download and install the extension. And that's it.

It should then appear with an icon just next to the address bar, and if you click it, it'll open up Selenium IDE.

And when you first open Selenium IDE, it'll give you a welcome screen. And it will also tell you the version, and then give you a prompt for a few different options that you can do.

So, you can either record a new test in a new project, open an existing project, or just create a new project without recording, or close the IDE. And of course, you can always head back to the project page to find more information.

Let's go ahead and record a new test in a project.

And when we do that, we're asked to name the project. So, this one will just be a project to test an application called 'the internet.'

And then it's going to prompt you for a URL, the base URL. And the base URL effectively is the application under test that you want, the environment that you want. So, for right now I'm going to use the public end point of 'the internet.' And then if I wanted to test against a staging mock-up, or a different environment, I could change the base URL and all the tests would work accordingly.

Once it's done, and inputted, you hit enter, or hit start recording. And it opens up a new window with the application, and then you can see an indicator on the bottom right, saying Selenium IDE is recording.

Let's go ahead and visit the log-in page for 'the internet,' and write a test that logs in and makes sure that we are successful in logging-in.

So, we visit the page and then the username and password are listed on this page, since it's a test application. So we can just go ahead and put in “tomsmith” and “SuperSecretPassword!”, and then click log-in. And then we're taken to the log-in page.

So, there's a couple of options here to add an assertion to our test. We could go to the IDE and add it manually, or from recording, there's actually the ability to right click, and there's a context menu, and in it there's the ability to assert.

Since we right clicked on an element, we can assert its text. And so, we'll go ahead and assert that we ended up getting the element containing the text you logged into a secure area.

Now if we hop back over to the IDE, we can stop recording by clicking the stop button up here. And then we'll be prompted to name the test. We'll just call this 'login,' and then hit “OK”.

And then if we expand this, we can see all of the commands that were recorded.

And, if we play this back, by hitting the play button up here, it'll step through everything we just did, and assuming everything works, all of these steps will be green.

As it's played back, each step will be attempted to be executed, and if it's successful it turns green, if it's unsuccessful it will turn red.

And down here at the bottom, there's a log of all of the actions that happen. And then for each command, there's also a reference tab which explains what each command does and what each of the inputs are.

And then for each command, there's obviously all the inputs. So, there's a target, a value, and a description. The reference tab can help explain what goes where for each command.

I'll get into what each of these buttons does in a later video. But for right now, let's go ahead and save this.

We can click the save button up here, and it will prompt us for a location to save it. So, we'll just save it to the downloads directory. And it's going to take the name of the project and append a file extension called '.side.'

****'Side' is the acronym for Selenium IDE, and it's its own file format. ****

I'll show you real quick what is contained within it (source code).

It's just a simple set of JSON effectively, that's in a 'side' file. And it's the entirety of the project that we just did, each node of the JSON is effectively either a command or rolled up into it into a full test, or into it a full suite.

Within Selenium IDE, there is the concept of a test, and there can be many tests, and then they can be grouped into a suite. Right now, we just have one test in one suite. And so, all it is, is just simple JSON for the entire project, so once you save it, it saves everything.

And then once you open up the IDE later, you would just click the “open project”, and then find the file that you saved, and it would open it.

And that's the basics of getting started with a simple "Hello World” example.



Resources



© 2024 Applitools. All rights reserved. Terms and Conditions Privacy Policy GDPR