How to import Selenium IDE test cases into Katalon Studio

Katalon Automation Recorder is designed to support users of the obsolete Selenium IDE to record and playback automation tests. It also allows users to export recorded automation test case to multiple scripting languages and frameworks. Generated test scripts can be enhanced with advanced conditions, dynamic validations and test data with Katalon Studio.
This tutorial will demonstrate how to import Selenium IDE test case into Katalon Studio by using generated test scripts from Katalon Automation Recorder.

In Selenium IDE, select the test case that you want to export. Select File > Save test case as. We need to save the test case as HTML format to import into Katalon Automation Recorder. Provide a name with “.html” and click Save.

Next, to import into Katalon Automation Recorder, start Katalon Automation Recorder extension (Chrome) or addon (Firefox), click 3 vertical dots at the end of Test case explorer, select Open Test Suite from the drop-down menu.

An Open test suite dialog will be displayed, select recent saved Selenium test case from step prior. Katalon Automation Recorder will import and display the imported test case.

Click Export on the main toolbar. An “Export Test Case as Script” window will display. Select Katalon Studio option from Language & Framework drop-down menu. Click Copy to Clipboard.

Open Katalon Studio desktop application and Create a new Test Case. In Test Case pane, select Script tab to switch to scripting mode.
(Tips: When creating a new Test Case, Katalon Studio will automatically include import libraries statement at the top of the editor. You can delete these import statements as it’s included in the generated script from Katalon Automation Recorder.)

Paste the copied Katalon Automation Recorder test script into the editor.

Or switch to Manual Tab to view test steps

Once finished editing, Save the test case and Run with preferred execution mode.

That’s how to leverage Katalon Automation Recorder to import Selenium IDE test cases into Katalon Studio for advanced conditions, dynamic validations, test data management, cross-browsers execution using external test data, and intuitive reports.

3 Likes

Hello Liam_B,

Is there a way to import the Selenium IDE 3 “.side” files?

Can you help me please after importing script to katalon studio here the error i got.

Blockquote
Test Cases/EClaims/Check Eligibility FAILED.
Reason:
com.thoughtworks.selenium.SeleniumException: Session ID is null. Using WebDriver after calling quit()?
Build info: version: ‘3.7.1’, revision: ‘8a0099a’, time: ‘2017-11-06T21:07:36.161Z’
System info: host: ‘ENIC-JQUINTO’, ip: ‘192.168.4.150’, os.name: ‘Windows 10’, os.arch: ‘amd64’, os.version: ‘10.0’, java.version: ‘1.8.0_181’
Driver info: driver.version: RemoteWebDriver
at com.thoughtworks.selenium.webdriven.SeleneseCommand.apply(SeleneseCommand.java:45)
at com.thoughtworks.selenium.webdriven.Timer.run(Timer.java:41)
at com.thoughtworks.selenium.webdriven.WebDriverCommandProcessor.execute(WebDriverCommandProcessor.java:150)
at com.thoughtworks.selenium.webdriven.WebDriverCommandProcessor.doCommand(WebDriverCommandProcessor.java:76)
at com.thoughtworks.selenium.DefaultSelenium.click(DefaultSelenium.java:198)
at com.thoughtworks.selenium.Selenium$click$0.call(Unknown Source)
at Check Eligibility.run(Check Eligibility:47)
at com.kms.katalon.core.main.ScriptEngine.run(ScriptEngine.java:194)
at com.kms.katalon.core.main.ScriptEngine.runScriptAsRawText(ScriptEngine.java:119)
at com.kms.katalon.core.main.TestCaseExecutor.runScript(TestCaseExecutor.java:337)
at com.kms.katalon.core.main.TestCaseExecutor.doExecute(TestCaseExecutor.java:328)
at com.kms.katalon.core.main.TestCaseExecutor.processExecutionPhase(TestCaseExecutor.java:307)
at com.kms.katalon.core.main.TestCaseExecutor.accessMainPhase(TestCaseExecutor.java:299)
at com.kms.katalon.core.main.TestCaseExecutor.execute(TestCaseExecutor.java:233)
at com.kms.katalon.core.main.TestCaseMain.runTestCase(TestCaseMain.java:114)
at com.kms.katalon.core.main.TestCaseMain.runTestCase(TestCaseMain.java:105)
at com.kms.katalon.core.main.TestCaseMain$runTestCase$0.call(Unknown Source)
at TempTestCase1564360679637.run(TempTestCase1564360679637.groovy:21)
Caused by: org.openqa.selenium.NoSuchSessionException: Session ID is null. Using WebDriver after calling quit()?
Build info: version: ‘3.7.1’, revision: ‘8a0099a’, time: ‘2017-11-06T21:07:36.161Z’
System info: host: ‘ENIC-JQUINTO’, ip: ‘192.168.4.150’, os.name: ‘Windows 10’, os.arch: ‘amd64’, os.version: ‘10.0’, java.version: ‘1.8.0_181’
Driver info: driver.version: RemoteWebDriver
at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:131)
at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:83)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:600)
at com.kms.katalon.selenium.driver.CChromeDriver.execute(CChromeDriver.java:20)
at org.openqa.selenium.remote.RemoteWebDriver.executeScript(RemoteWebDriver.java:536)
at com.thoughtworks.selenium.webdriven.commands.AlertOverride.replaceAlertMethod(AlertOverride.java:40)
at com.thoughtworks.selenium.webdriven.commands.Click.handleSeleneseCommand(Click.java:37)
at com.thoughtworks.selenium.webdriven.commands.Click.handleSeleneseCommand(Click.java:26)
at com.thoughtworks.selenium.webdriven.SeleneseCommand.apply(SeleneseCommand.java:36)
at com.thoughtworks.selenium.webdriven.Timer.run(Timer.java:41)
at com.thoughtworks.selenium.webdriven.WebDriverCommandProcessor.execute(WebDriverCommandProcessor.java:150)
at com.thoughtworks.selenium.webdriven.WebDriverCommandProcessor.doCommand(WebDriverCommandProcessor.java:76)
at com.thoughtworks.selenium.DefaultSelenium.click(DefaultSelenium.java:198)
at com.thoughtworks.selenium.Selenium$click$0.call(Unknown Source)
at Script1564360176059.run(Script1564360176059.groovy:47)
… 11 more

Here’s the script:

Blockquote

import static com.kms.katalon.core.checkpoint.CheckpointFactory.findCheckpoint
import static com.kms.katalon.core.testcase.TestCaseFactory.findTestCase
import static com.kms.katalon.core.testdata.TestDataFactory.findTestData
import static com.kms.katalon.core.testobject.ObjectRepository.findTestObject
import com.kms.katalon.core.checkpoint.Checkpoint as Checkpoint
import com.kms.katalon.core.checkpoint.CheckpointFactory as CheckpointFactory
import com.kms.katalon.core.mobile.keyword.MobileBuiltInKeywords as MobileBuiltInKeywords
import com.kms.katalon.core.model.FailureHandling as FailureHandling
import com.kms.katalon.core.testcase.TestCase as TestCase
import com.kms.katalon.core.testcase.TestCaseFactory as TestCaseFactory
import com.kms.katalon.core.testdata.TestData as TestData
import com.kms.katalon.core.testdata.TestDataFactory as TestDataFactory
import com.kms.katalon.core.testobject.ObjectRepository as ObjectRepository
import com.kms.katalon.core.testobject.TestObject as TestObject
import com.kms.katalon.core.webservice.keyword.WSBuiltInKeywords as WSBuiltInKeywords
import com.kms.katalon.core.webui.driver.DriverFactory as DriverFactory
import com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords as WebUiBuiltInKeywords
import internal.GlobalVariable as GlobalVariable
import com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords as WebUI
import com.kms.katalon.core.mobile.keyword.MobileBuiltInKeywords as Mobile
import com.kms.katalon.core.webservice.keyword.WSBuiltInKeywords as WS
import com.thoughtworks.selenium.Selenium as Selenium
import org.openqa.selenium.firefox.FirefoxDriver as FirefoxDriver
import org.openqa.selenium.WebDriver as WebDriver
import com.thoughtworks.selenium.webdriven.WebDriverBackedSelenium as WebDriverBackedSelenium
import static org.junit.Assert.*
import java.util.regex.Pattern as Pattern
import static org.apache.commons.lang3.StringUtils.join
import com.kms.katalon.core.cucumber.keyword.CucumberBuiltinKeywords as CucumberKW

WebUI.openBrowser(‘https://www.katalon.com/’)

def driver = DriverFactory.getWebDriver()

String baseUrl = ‘https://www.katalon.com/

selenium = new WebDriverBackedSelenium(driver, baseUrl)

//selenium.open(‘http://192.168.8.9:82/offline/’)

WebUI.callTestCase(findTestCase(‘Log In/Log In (S) - Copy’), [(‘Username’) : ‘admin1’, (‘Password’) : ‘P@ssw0rd’], FailureHandling.STOP_ON_FAILURE)

WebUI.click(findTestObject(‘Page_Home - Easy Claims/span_Home’))

WebUI.click(findTestObject(‘Page_Home - Easy Claims/a_File Claim’))

selenium.click(‘//*[@id=“addClaimBtn”]’)

selenium.type(‘id=MemberLastName’, ‘BABY’)

selenium.type(‘id=MemberFirstName’, ‘BABY’)

selenium.type(‘id=MemberMiddleName’, ‘BABY’)

selenium.type(‘id=MemberBirthDate’, ‘5/20/1993’)

selenium.click(‘//*[@id=“memberInfo”]/div[3]/div/label[2]’)

selenium.setText(‘id=MemberPIN’, ‘01-052211914-9’)

selenium.click(‘id=MailingAddress’)

selenium.type(‘id=MailingAddress’, ‘TAYTAY’)

selenium.setText(‘id=ZipCode’, ‘1920’)

selenium.click(‘xpath=(.//*[normalize-space(text()) and normalize-space(.)='Member Type'])[1]/following::span[3]’)

selenium.click(‘xpath=(.//*[normalize-space(text()) and normalize-space(.)='Member Type'])[1]/following::span[3]’)

selenium.click(‘xpath=(.//*[normalize-space(text()) and normalize-space(.)='Employed Government'])[1]/following::li[1]’)

selenium.click(‘xpath=(.//*[normalize-space(text()) and normalize-space(.)='Patient Is'])[1]/following::span[3]’)

selenium.click(‘xpath=(.//*[normalize-space(text()) and normalize-space(.)='Select One'])[1]/following::span[2]’)

selenium.click(‘xpath=(.//*[normalize-space(text()) and normalize-space(.)='Select One'])[3]/following::li[1]’)

selenium.click(‘xpath=(.//*[normalize-space(text()) and normalize-space(.)='Admission Date and Time'])[1]/following::span[4]’)

selenium.click(‘link=1’)

selenium.click(‘xpath=(.//*[normalize-space(text()) and normalize-space(.)='Save for E-Claims?'])[1]/following::label[1]’)

selenium.type(‘//*[@id=“TransmittalNo”]’, ‘TEST 5135’)

selenium.type(‘id=ClaimNumber’, ‘5315’)

selenium.click(‘//*[@id=“eligibilityForm”]/div[11]/div/input’)

Hello

In addition to importing Selenium/TestNG/JUnit projects into Katalon Studio, from version 7.5.10 onwards, you can also import a Selenium IDE project for execution with Katalon Studio.

Download 7.5.10 here.

Requirements

  • Katalon Studio version 7.5.10 onwards
  • An active Katalon Studio Enterprise license

Jass