Troubleshoot common exceptions when executing web tests

Tips

  • Please use Ctrl+F to look for the exceptions and errors you have encountered quickly.
  • If the exception you are looking for is not documented, please leave a comment below to request a proposed solution from the Katalon team.

Issue Solution
com.kms.katalon.core.webui.exception.WebElementNotFoundException: Web element with id ... not found.

Update WebDriver via the Katalon tool:

On main toolbar, select Tool > Update WebDrivers > select the corresponding browser in the drop-down list.
com.kms.katalon.core.webui.exception.WebElementNotFoundException: Web element with id ... not found.

Try one of the following solutions to resolve the issue:

  1. Correct the element's XPath locator.
    • Open your page using Chrome.
    • Right-click on your desired test object > select Inspect.
    • In the Elements tab of DevTool, right-click on your target object and select CopyCopy XPath.
    • Open your test object in Katalon Studio > update XPath property with the copied value.
  2. Optimize object identification and tools.
selenium.ElementNotVisibleException: Element is not currently visible and so may not be interacted. Add the Wait For Element Visible step before the one having this issue. For example:
WebUI.openBrowser('http://demoaut.katalon.com')
WebUI.waitForElementVisible(findtestObject('btn_Login'),30)
WebUI.click(findTestObject('btn_Login'))
org.openqa.selenium.InvalidElementStateException: invalid element state: Element is not currently interactable and may not be manipulated.

Try one of the following solutions to resolve the issue:

  1. Wait until the element is visible.
  2. Set a value directly using Javascript.
import com.kms.katalon.core.webui common.WebUiCommonHelper
WebElement element = WebUiCommonHelper.findWebElement(findTestObject('your/object'),30)
WebUI.executeJavaScript("arguments[0].value='Your Value'", Arrays.asList(element))

org.openqa.selenium.WebDriverException: Element is not clickable at point (x, y). Other element would receive the click: ...

Click on the element using Javascript instead.

import com.kms.katalon.core.webui.common.WebUiCommonHelper
WebElement element = WebUiCommonHelper.findWebElement(findTestObject('your/object'),30)
WebUI.executeJavaScript("arguments[0].click", Arrays.asList(element))

Timed out waiting for driver server to start.
  • Download correct Edge driver from this page: https://developer.microsoft.com/en-us/microsoft-edge/tools/webdriver/ based on your OS build (Go to Start > Settings > System > About and locate the number next to OS Build on the screen).
  • Copy downloaded Edge driver and replace it in existing edgedriver folder of Katalon Studio. For example: C:\\Katalon\_Studio\_Windows_64-4.8\\configuration\\resources\\drivers\\edgedriver
Unable to record on Internet Explorer.
Unable to connect to Katalon server.

Allow the following .exe files to communicate through Windows Firewall. Here is the full guide to access this interface:

  • geckodriver.exe
  • chromedriver.exe
  • iedriverserver.exe

These executable files can be located in: <Katalon Studio folder>\\configuration\\resources\\drivers.

You may also need to add Google Chrome (chrome.exe) and Firefox (firefox.exe) in the worst case if your current Windows Firewall block them as well.

Use different browser versions. In case you want Katalon Studio to use different versions besides the current installed version, there are two ways to do it:
  1. Use custom keywords.
    • These Firefox instances should be installed on your machine first.
    • Create a custom keyword to open the browser. Press Ctrl + Shift + O to automatically import necessary packages.
      Learn more.
      package com.example
      import org.openqa.selenium.WebDriver
      import org.openqa.selenium.chrome.ChromeDriver
      import org.openqa.selenium.chrome.ChromeOptions
      import org.openqa.selenium.firefox.FirefoxDriver
      import com.kms.katalon.core.annotation.Keyword
      import com.kms.katalon.core.webui.driver.DriverFactory
      

      public class WebUICustomKeywords {  @Keyword  def openFirefoxBrowser(String firefoxPath, String firefoxDriver) {   //Set path to Firefox version   System.setProperty("webdriver.firefox.bin", firefoxPath)   //Set path to Firefox driver: \configuration\resources\drivers\firefox_win64\geckodriver.exe   System.setProperty("webdriver.gecko.driver", firefoxDriver)   WebDriver driver = new FirefoxDriver()   DriverFactory.changeWebDriver(driver)  }

       @Keyword

       def openChromeBrowser(String chromeDriverPath, String chromePath)  { //Set path to chromedriver driver: \configuration\resources\drivers\chrome_win32\chromedriver.exe   System.setProperty("webdriver.chrome.driver", chromeDriverPath)   ChromeOptions options = new ChromeOptions() //Set path to Chrome binary   options.setBinary(chromePath)   WebDriver driver = new ChromeDriver(options)   DriverFactory.changeWebDriver(driver)  } }

    • In a test case, use this custom keyword instead of 'Open Browser' keyword.
      For example.
      CustomKeywords.'com.example.WebUICustomKeywords.openFirefoxBrowser'('C:\Program Files\Mozilla Firefox 52\firefox.exe', 
       'C:\5.4\Katalon Studio Windows 64\configuration\resources\drivers\firefox_win64\geckodriver.exe')

      WebUI.navigateToUrl(GlobalVariable.G_SiteURL)

      WebUI.click(findTestObject('Page_CuraHomepage/btn_MakeAppointment'))

    • Downgrade browser's version: Another approach is downgrade your current browser's version to a version you want. If you want to use a very old version of your current browser, you may need to downgrade or upgrade browser's drivers as well as Selenium WebDriver, please refer to this guide.

The exception you are looking for is not on this page?

Leave a comment below.

Feedback