Katalon Studio's element creation through webDriver is not detected within Javascript

I am attempting to utilize the executeJavascript function in Katalon Studio. After writing some code resembling the example provided in the documentation, I imported WebElement into my script as well:

documentation example: https://i.sstatic.net/8Lp3P.png

my script: https://i.sstatic.net/WVm1D.png

Despite this, when running the test, an error message is displayed:

Test Cases/Forms/Test1 - fill in maintenance request form FAILED because (of) Unable to execute JavaScript. (Root cause: org.openqa.selenium.WebDriverException: unknown error: element is not defined
(Session info: chrome=66.0.3359.181)
(Driver info: chromedriver=2.35.528157 (4429ca2590d6988c0745c24c8858745aaaec01ef),platform=Mac OS X 10.13.4 x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 0 milliseconds
Build info: version: '3.7.1', revision: '8a0099a', time: '2017-11-06T21:07:36.161Z'
System info: host: 'Nikkis-MacBook-Pro.local', ip: 'fe80:0:0:0:18e2:b2c7:8b31:3164%en0', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.13.4', java.version: '1.8.0_102'
Driver info: com.kms.katalon.selenium.driver.CChromeDriver
Capabilities {acceptInsecureCerts: false, acceptSslCerts: false, applicationCacheEnabled: false, browserConnectionEnabled: false, browserName: chrome, chrome: {chromedriverVersion: 2.35.528157 (4429ca2590d698..., userDataDir: /var/folders/fl/d70hxqb520v...}, cssSelectorsEnabled: true, databaseEnabled: false, handlesAlerts: true, hasTouchScreen: false, javascriptEnabled: true, locationContextEnabled: true, mobileEmulationEnabled: false, nativeEvents: true, networkConnectionEnabled: false, pageLoadStrategy: normal, platform: MAC, platformName: MAC, rotatable: false, setWindowRect: true, takesHeapSnapshot: true, takesScreenshot: true, unexpectedAlertBehaviour: , unhandledPromptBehavior: , version: 66.0.3359.181, webStorageEnabled: true}
Session ID: 05ebb4c39e0862af7f3893c442527a3b)

Test Cases/Forms/Test1 - fill in maintenance request form.run:65

Even after updating selenium, chrome driver, and java, the same error persists:

Unable to execute JavaScript. (Root cause: org.openqa.selenium.WebDriverException: unknown error: element is not defined   (Session info: chrome=66.0.3359.181)   (Driver info: chromedriver=2.38.552518 (183d19265345f54ce39cbb94cf81ba5f15905011),platform=Mac OS X 10.13.4 x86_64) (WARNING: The server did not provide any stacktrace information) Command duration or timeout: 0 milliseconds Build info: version: '3.12.0', revision: '7c6e0b3', time: '2018-05-08T15:15:08.936Z' System info: host: 'Nikkis-MacBook-Pro.local', ip: 'fe80:0:0:0:18e2:b2c7:8b31:3164%en0', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.13.4', java.version: '1.8.0_102' Driver info: com.kms.katalon.selenium.driver.CChromeDriver Capabilities {acceptInsecureCerts: false, acceptSslCerts: false, applicationCacheEnabled: false, browserConnectionEnabled: false, browserName: chrome, chrome: {chromedriverVersion: 2.38.552518 (183d19265345f5..., userDataDir: /var/folders/fl/d70hxqb520v...}, cssSelectorsEnabled: true, databaseEnabled: false, handlesAlerts: true, hasTouchScreen: false, javascriptEnabled: true, locationContextEnabled: true, mobileEmulationEnabled: false, nativeEvents: true, networkConnectionEnabled: false, pageLoadStrategy: normal, platform: MAC, platformName: MAC, rotatable: false, setWindowRect: true, takesHeapSnapshot: true, takesScreenshot: true, unexpectedAlertBehaviour: , unhandledPromptBehavior: , version:
66.0.3359.181, webStorageEnabled: true} Session ID: 2c4f4643acb4d1c0a106ac0fb9e31254)

The continuing occurrence of this error perplexes me, and I seek guidance on how it can be resolved.

Answer №1

This error message...

org.openqa.selenium.WebDriverException: unknown error: element is not defined

...suggests that the ChromeDriver encountered difficulty communicating with the Browsing Context, specifically the Chrome Browser session.

Your primary concern lies in the version compatibility among the components you are utilizing:

  • You are using chromedriver=2.35
  • The Release Notes for chromedriver=2.35 explicitly state:

Supports Chrome v62-64

Supports Chrome v65-67

  • Your Selenium Client version is 3.7.1 dated 2017-11-06T21:07:36.161Z which is considerably outdated.
  • Your JDK version is 1.8.0_102, quite antiquated.

There exists a glaring mismatch between the JDK v8u102, Selenium Client v3.7.1, ChromeDriver version v2.35, and the Chrome Browser v66.0.

Solution

  • Update your JDK to a recent release such as JDK 8u171.
  • Upgrade your Selenium to the latest version available at Version 3.12.0.
  • Ensure your ChromeDriver is up to date by downloading ChromeDriver v2.38.
  • Maintain a consistent Chrome version at Chrome v66.x levels (as per ChromeDriver v2.38 release notes).
  • Cleanse your Project Workspace within your IDE and Rebuild the project with only necessary dependencies.
  • Utilize CCleaner to streamline system tasks before and after executing your test Suite.
  • If your underlying Web Client is outdated, uninstall it via Revo Uninstaller and install an updated version.
  • Perform a System Reboot.
  • Execute your @Test.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Ajax request causing bootstrap success message to have shorter visibility

I encountered an issue with my ajax form that retrieves data using the PHP post method. Instead of utilizing the alert function in JavaScript, I decided to use a bootstrap success message. However, there is a problem as the message only appears for less th ...

What strategies can I use to keep my Google Places API key secure within the index.html of my React application?

I'm working with a mern stack and I have a payment page. I'm looking to incorporate the Google Places API for an address auto-complete feature in my form. I have the basic form structure in place, but I'm unsure of how to properly add the ne ...

Instructions on merging elements in an array with identical property values

Consider the array below: [{a:1,b:1},{a:5,b:2},{a:10,b:2},{a:20,b:3}] Is there a way to create a new array that merges elements with the same b value, while adding up the corresponding a values? The desired output should be as follows: [{a:1,b:1},{a:(5+10 ...

Retrieving a single item from an array of objects with the help of body parser

I need assistance with sending an array of objects to a post route in my express app. Here is my form (written in ejs format): <form action="/archiveList/<%= list._id %>" method="POST"> <input type="hidden" name="list" value = <%= items ...

Transforming a file with a node module that lacks a .js class into a browseable format

I am currently working on browserifying my module. One of the dependencies I have is on this https://www.npmjs.com/package/chilkat_win32. It is present in my node_modules folder and here is how the structure looks: https://i.stack.imgur.com/uw9Pg.png Upo ...

Dynamic content display using AJAX

Having already tried to find a solution through Google with no success, I am at a loss. I have articles where a paragraph is initially displayed, followed by a "read more" link which reveals more content using JavaScript. However, this approach may slow do ...

Can Python integrate the HTMLUnit driver for use with Selenium?

I'm curious about running my Selenium test scripts using HTML Unit as the browser/driver. Can I combine HTML with Python for this purpose? I attempted to do so with the following code snippet: driver = webdriver.Remote(desired_capabilities=webdriver. ...

Why is the Jquery console not displaying any values?

Hey everyone, I need some help with a small issue in my project. For some reason, the console.log() function in my project is not returning any values. <script> $('#search-box<?=$x;?>').blur(function() { var val = $("#search ...

utilizing selenium chromedriver for file uploading操作

I've been using selenium chromedriver to automate tasks, such as logging in, checking checkboxes, and navigating web pages. However, I've run into a roadblock while trying to upload a file. The upload page has multiple buttons that open dialog b ...

The jQuery code causes IE6 to crash

The code snippet above is triggering a crash in IE6 every time it runs. The page keeps refreshing and eventually crashes after a minute: $(window).bind("load resize", function () { var hnf = $('#header').height() + $('#footer').hei ...

How can I dynamically set the option attribute to "selected" and remove it when another option is chosen?

Before marking this as a duplicate, please read on: Initial Scenario: I am working with a select list and need to dynamically set the selected attribute when a specific option is chosen. Following Actions: Subsequently, when another option is selected fr ...

Detect changes in class properties using Node.js

Is it feasible to establish direct proxy watchers for class properties in Node.js? class User{ constructor(name){ this.name = name; let pObject = new Proxy(this,{ set: () => { console.log("something cha ...

To begin utilizing Node.js modules, you must use the `#` symbol as the starting point

Quoting the Nodejs documentation, available at this link require(X) from module at path Y 1. If X is a core module, a. return the core module b. STOP 2. If X begins with '/' a. set Y to be the filesystem root 3. If X begins with './ ...

Scrolling is endless with jCarousel - just press a button to keep moving even when you reach the first or

I seem to be experiencing a problem with jCarousel where, upon starting at the beginning, pressing the left button fails to scroll the carousel. The expected behavior is for the carousel to cycle to the end item when the left button is pressed while the f ...

What are the different ways to utilize request.profile in a Node.js environment?

I recently stumbled upon a code snippet that utilizes req.profile to read data. How is this even possible? const listNewsFeed = async (req, res) => { let following = req.profile.following following.push(req.profile._id) try{ let posts = await ...

The placement of an object on a webpage

Seeking the (x,y) coordinates of an element using JavaScript, utilizing the offset property from jQuery. Here is my code snippet: var offsets = $('#11a').offset(); var top = offsets.top; var left = offsets.left; console.log("Coor ...

Load a new texture dynamically in THREE.JS and GLTF during runtime

I am relatively new to Three.JS and have made progress, but I am in need of assistance. I have successfully loaded a GLTF object into the scene and now I am looking to implement a feature that allows users to customize the object by selecting different te ...

What strategies can I implement to integrate Cordova with a combination of Meteor and React?

I'm currently struggling to implement a Cordova plugin with Meteor and React. According to the documentation: You should wrap any functionality that relies on a Cordova plugin inside a Meteor.startup() block to ensure that the plugin has been fully ...

Navigate to the specified URL once the Ajax function has completed successfully

I'm having trouble with opening a URL from an Ajax function. It seems like the URL is not being called. This is the code I am using: $(document).on( "click",".btndriver", function() { var id = $(this).attr("id"); var nombre = $(this).att ...

How to Deactivate Navigation Tabs in AnythingSlider?

I am encountering some issues with the css and js while using the AnythingSlider tool. Specifically, I want to modify the navigation tabs in a way that certain tabs will either remain unchanged or become inactive based on a ColdFusion conditional. For ins ...