Yet another Selenium IDE alternative: Silk WebDriver
The Software QA community has been going gaga over the retirement of the once most popular web automation tool ‘Selenium IDE’ since Firefox has officially ended support of browser plugins starting Firefox 55 version as mentioned in the official SeleniumHQ blog. Though the QA community has already come over the traditional ‘Record and playback’ techniques of web automation with the introduction of several other robust technologies like Selenium WebDriver, but still this remains a niche segment.
Many companies are still working full-time to provide easy record and playback solutions to the software QA community. Some of them are paid tools like HP UFT, Ranorex, etc. and some are free like Katalon Studio. In this article, let me introduce you to yet another such free Record and Playback solution called Silk WebDriver provided by MicroFocus (Formerly HPE Software). The company behind some popular functional automation tools like ‘UFT’, ‘Silk Test’, etc.
First of all download your free copy of Silk WebDriver from the official website and register yourself for an account in this link. After that install it in your system and open it. You will most probably be seeing this window:
Once the Silk WebDriver window is open, click on Log In and sign-in using your valid credentials you have set in the registration page.
Once you have successfully logged in, let’s automate the following simple scenario:
- Open OrangeHRM Login Page in Chrome browser
- Enter valid credentials
- Login
- Verify “Welcome <Username>” is displayed (To check successful login)
- Logout
- Verify Login button displayed (To check successful logout)
N.B.: Here we will be using a demo application called OrangeHRM and here is the link to access the same: http://opensource.demo.orangehrmlive.com/.The username and password is mentioned in the login page itself.
Following are the steps you may follow to automate the same scenario:
Step 1: Click Record new script in the Silk WebDriver main window to start the recording process.
Click this to start Record process
Step 2: Once you click on Record new script, you will be displayed this window which will automatically detect all the browsers installed in your system on which you want to automate the scenario. There is also an URL field in which you have to give the link of your AUT (Application under test). In this example we will be using Chrome browser and OrangeHRM. After selecting your desired browser and URL input, click Ok.
Select Browser and Input URL of the test application
Step 3: Now you will see that Chrome browser has opened. Please stand by/wait for the Recorder window to open too. You will see something like this:
Left: Browser; Right: Silk WebDriver Recorder
Step 4: As you can see in the above screenshot that Silk WebDriver has already started recording process. Now we already have started automating the 1st step of our test scenario, i.e., ‘Open OrangeHRM Login Page in Chrome browser’.
Step 5: Now we will have to perform some actions on web elements. For that all you need to do is right click on respective web elements to open a pop-up and select the action you need to perform on that element. You can see a pop-up like this when you right click on a web element and these actions can be performed.
Step 6: So now let’s automate the 2nd step of our test scenario which is to enter valid user credentials. For that we need to right click on Username text field and select ‘SendKeys’ from Action dropdown of the pop-up and give the valid username. Same for password too.
Perform ‘SendKeys’ action in ‘Username’ text field.
Step 7: Now just click on ‘Login’ button and Silk WebDriver will record the same. The Silk WebDriver will automatically set the click operations and you do not need to right click and set click action manually. If you had given correct credentials it must login or else you receive an error message.
Step 8: Once we have logged in we have to verify that “Welcome <Username>” is displayed. For that just right click on that element and click on the verifier icon as displayed below.
Click on the icon displayed beside Action dropdown to open Verification window
Step 9: It will open this windows containing the locator strategy and verification properties.
Verify Properties window
Step 10: Now let’s say, we want to verify multiple properties of the particular web element, i.e., element is displayed and text is “Welcome <Username>”. For that we need to select ‘IsDisplayed’ and ‘Text’ checkboxes in Property Name column. After selecting the required verification properties click ‘Ok’.
Step 11: Now just perform click operations to logout of the application.
Step 12: Now we will verify whether we have logged out successfully. For that, we will verify ‘Login’ button is present or not. We will follow the same verification properties window method as explained in Step # 9 and 10.
Verify login button visible. Select ‘IsDisplayed’ as Verification Property in the Verify Properties window.
Step 13: Now since we have recorded all steps as per scenario we can stop the recording by clicking the ‘Stop’ button. And Silk WebDriver will ask to Save your test case or not. For beginners, you must save the recorded steps and later modify as per requirement.
After all steps are recorded click on ‘Stop’ button and save your recording in your desired location
Step 14: Now you can close both the browser and Silk WebDriver Recorder window to return back to the Silk WebDriver Main window. As you can see your recorded and save test case is already visible below ‘Files’ in the left pane of the main window. To open your saved test cases you may click on the files if visible in the left pane or click on ‘Open existing script’ and navigate to the directory where you have saved your recorded script and open the same.
Step 15: After you load your saved recording script, Silk WebDriver will ask to select the browser you want to play your recording. Now see that the URL field is already pre-filled with the URL of your AUT. Click Ok and once both browser and Silk WebDriver window are opened you can click on Play button to run your script. Once all steps are successfully played you can see tick marks displayed beside each step in the Silk WebDriver window.
Tick mark ensures successful run of the steps
Another feature of the Silk WebDriver tool is that you can export your recorded scripts/ test cases to your preferred language files from the Silk WebDriver Recording Window.
As you can see these are the available/supported languages in which Silk WebDriver can export your test cases. You just need to click on the menu button, select ‘Export’ and save the file in your desired location.
As you can see here, Silk WebDriver has successfully exported your test script into your preferred language (for me it’s Java) file and also has set the required system properties for Chrome as browser.
Therefore, we can assume that Silk WebDriver can also be a good alternative if you are looking to automate some simple scenarios and save the time of writing codes by a good margin.
Advantages of Silk WebDriver
- It’s Free. Once you have registered for a free account you are good to go.
- Simple but robust UI.
- Automatically detects available browsers in the system.
- Export test cases to required languages feature available. It can save a lot of time here.
- Very less learning curve.
Disadvantages
- It is supported only in Windows.
- It does not support Internet Explorer.
- Though you can export your test cases to your preferred language but still if there was a Script mode with some language support natively like in Katalon Studio, it could have become a cool competitor.
- We cannot handle dynamic web elements because we are not allowed to edit the locators of captured web elements during recording. For this I had put a question in their feature request forum and they have replied that it will be implemented soon. Therefore, we can wait for them to update the same.
About the Author
I am Prithviraj Sahoo and I am a software test engineer. I am having 2+ years of experience in software quality assurance field. I have worked both as a manual and automation test engineer in my career and I am very much interested to be of some help in expanding your knowledge boundaries in terms of software test automation. I am quite proficient with Functional test automation technologies like Selenium WebDriver, Katalon Studio, Ranorex.io, etc. and Non-Functional tools like Jmeter, Gatling, Redline13, etc. I also love to and look forward to learn new technologies in SQA field and implement the same in the projects on which I work on. Coming to my location, I am staying at Bhubaneswar, OD, IN and you can get connected with me on LinkedIn and Facebook.