Encountering org/openqa/selenium/remote/SessionNotFoundException error while executing JMeter tests in Jenkins

Recently, I encountered an issue when trying to run web app JMeter tests using the Firefox Driver in Jenkins.

I was able to successfully execute the tests in non-GUI mode on the terminal of the Jenkins server. I could also run the tests successfully on the Jenkins server with the JMeter UI. But when I triggered it through a Jenkins job, it threw the following error:

jmeter -n -t jmeter.jmx -l result.jtl 

Writing log file to: /var/lib/jenkins/workspace/test/srm-bermuda/jmeter.log
Error in NonGUIDriver java.lang.IllegalArgumentException: Problem loading XML from:'/var/lib/jenkins/workspace/test/srm-bermuda/jmeter.jmx', missing class com.thoughtworks.xstream.converters.ConversionException: org/openqa/selenium/remote/SessionNotFoundException : org/openqa/selenium/remote/SessionNotFoundException
---- Debugging information ----
message             : org/openqa/selenium/remote/SessionNotFoundException
cause-exception     : java.lang.NoClassDefFoundError
cause-message       : org/openqa/selenium/remote/SessionNotFoundException
first-jmeter-class  : org.apache.jmeter.save.converters.TestElementConverter.unmarshal(TestElementConverter.java:100)
class               : org.apache.jmeter.save.ScriptWrapper
required-type       : com.googlecode.jmeter.plugins.webdriver.config.FirefoxDriverConfig
converter-type      : org.apache.jmeter.save.ScriptWrapperConverter
path                : /jmeterTestPlan/hashTree/hashTree/hashTree/com.googlecode.jmeter.plugins.webdriver.config.FirefoxDriverConfig
line number         : 29
version             : 3.0 r1743807

If anyone has a solution, I would greatly appreciate the help!

Here is the full Jenkins log containing the details printed out by the jmeter.log as well:

+ cd srm-bermuda
+ ls
jmeter.jmx
jmeter.log
jmeter_UI.jmx
simple.jmx
success_login.jmx
test.har
+ result=result.jtl
+ [ -f result.jtl ]
+ rm -rf dashboard
+ export     PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/var/lib/jenkins/.rvm/bin:/data/jre1.7.0_79/bin:/data/apache-jmeter-3.0/bin:/data/apache-jmeter-3.0/lib:/data/apache-jmeter-3.0/lib/ext
+ jmeter -n -t jmeter_UI.jmx -l result.jtl -H cn-proxy.jp.oracle.com -P 80
Writing log file to: /var/lib/jenkins/workspace/test/srm-bermuda/jmeter.log
Error in NonGUIDriver java.lang.IllegalArgumentException: Problem loading     XML from:'/var/lib/jenkins/workspace/test/srm-bermuda/jmeter_UI.jmx', missing     class com.thoughtworks.xstream.converters.ConversionException:     org/openqa/selenium/WebDriverException : org/openqa/selenium/WebDriverException
---- Debugging information ----
message             : org/openqa/selenium/WebDriverException
cause-exception     : java.lang.NoClassDefFoundError
cause-message       : org/openqa/selenium/WebDriverException
first-jmeter-class  : org.apache.jmeter.save.converters.TestElementConverter.unmarshal(TestElementConverter.java:100)
class               : org.apache.jmeter.save.ScriptWrapper
required-type       : com.googlecode.jmeter.plugins.webdriver.config.FirefoxDriverConfig
converter-type      : org.apache.jmeter.save.ScriptWrapperConverter
path                : /jmeterTestPlan/hashTree/hashTree/hashTree/com.googlecode.jmeter.plugins.webdriv    er.config.FirefoxDriverConfig
line number         : 29
version             : 3.0 r1743807
-------------------------------
+ cat jmeter.log
2016/11/24 16:12:16 INFO  - jmeter.util.JMeterUtils: Setting Locale to en_US 
(continue with the rest of the log...)

Answer №1

Encountering a "NoClassDefFoundError" error typically signifies that the required .jar file containing the class is not in the Java Classpath, or specifically in the JMeter Classpath. In the case of JMeter Plugins, it is common for individuals to place plugin libraries in the "lib/ext" folder without also installing dependencies into the "lib" folder within their JMeter installations. This may be the cause of your issue as well. To address this problem, I suggest considering two options:

  1. Compare the contents of the "lib" and "lib/ext" folders in your JMeter installations on:

    • a machine where the test runs successfully
    • the Jenkins build agent

    Make any necessary adjustments to ensure both folders are identical.

  2. The preferred method for installing and keeping JMeter Plugins up-to-date is by using the JMeter Plugins Manager. This allows you to obtain a clean distribution of the latest version of JMeter and easily install all required plugins using the Plugins Manager tool.

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

In Python, selenium repeatedly captures screenshots of the same first element within the loop

Trying to capture individual screenshots of every comment within a Reddit post using Selenium in Python has been quite the challenge. All comments share the same id/class which I have used for selection. Below is the snippet of code that I am currently wo ...

Scraping data using Selenium with paragraph tags

I've been scouring the internet for examples similar to the one in question, but with no luck. The challenge at hand revolves around extracting text from a webpage where only one of two p tags contains important information. How can data be extracted ...

Verify that the select field has been chosen using Protractor

Currently, I am in the process of developing a test that places importance on whether a select field has already been populated. it('should automatically select a field if it hasn't been selected previously', function() { var usersField = ...

Extracting information from a webpage

I am trying to extract the text from the XPath provided below using Selenium. However, I keep encountering the following traceback error: date = driver.find_element_by_xpath('//[@id="General"]/fieldset/dl/dd[5]/text()').text() print(date) Error ...

Automating Dropdown Selection with Python using Selenium

I am currently attempting to interact with a dropdown box on a webpage. The code snippet related to the dropdown is as follows: <span class="sui-dropdown" tabindex="0" style="width: 150px;"> <select class="dropdo ...

Examine the differences between a selenium object list and a list of strings

I have a challenge in my Twitter automation project. I have two lists, items_on_queue and things_to_tweet, that I need to compare to eliminate duplicates and create a unique list for posting. The issue is that the two lists are in different formats, and I ...

Dynamic button on dialog box could not be found

When I click on the search button, I am having trouble locating a dynamic button element. The Create Account CID is sometimes clickable and sometimes not. <div class="pzbtn-rgt" data-click="..."> <div class="pzbtn-mid" data-click="...."> < ...

Exception encountered for Internet Explorer when attempting to launch from WebDriver: 405 Method Not Allowed

After trying to launch IE from Webdriver and clicking on save, I encountered a "405 Method not allowed" exception. However, when I manually launched IE and clicked on save, it worked fine. I'm perplexed by this issue. Any ideas as to why it might be ...

Unraveling Traceback Errors in Python using Selenium WebDriver

Exploring the world of selenium webdriver for the first time is proving to be quite a challenge. After updating to Python 3.6 and reinstalling selenium, I attempted to open a basic webpage, only to encounter errors right off the bat. Here's the code s ...

Difficulty encountered with XPath when using specific ID

As a newcomer to Selenium, I am currently in the process of learning all aspects at once. Sometimes, I still face challenges in understanding HTML notation. Despite conducting thorough research on the internet and documentation, I have yet to achieve succ ...

converting webdriver code into integers

I am attempting to extract variables 'a' and 'b' from this HTML code. Currently, I am working on creating an automation script using Python and Selenium. The task involves a math game website where users perform addition, subtraction, ...

Encountering a Selenium Webdriver issue of "Element not click-able at specified point" in regards to PrimeFaces SelectOneMenu

I've browsed through various resources to find a solution to my current issue, but none of the suggested fixes seem to work for me. The problem I'm facing is that my tests on SelectOneMenu elements are successful in Firefox and Internet Explorer, ...

What methods are available for transforming my Python GUI program into a desktop application?

Recently, I created a Python program with a GUI included. Now, I'm looking to turn this program into a desktop app that can be opened without the need for a text editor or command line execution. The program itself searches for and plays the first vid ...

Issues were encountered in the Suite Class as it failed to trigger the methods annotated with @BeforeClass and

I have a collection of test cases that require the use of @BeforeClass and @AfterClass annotations in JUnit to set up and tear down resources before and after execution. While these methods work correctly when running the suite class through JUnit, they ...

Apache Airflow: ImportError - Couldn't find the module named 'selenium'

Currently, I am running apache-airflow locally using docker. However, I encountered an issue when trying to import selenium into one of my dags that involves web scraping data on a regular basis. Despite running the pip install command in the console and r ...

Experiencing difficulties with Python Selenium in Opera browser when trying to access Youtube

I have been experimenting with the code found on this URL, and it seems to be functioning well for Opera browser- Driving Opera using Selenium in Python import time from selenium import webdriver from selenium.webdriver.chrome import service webdriver_s ...

Issues with Selenium getting stuck while using pyvirtualdisplay

Running Selenium with Python on a server requires the ability to hide the Chrome display. Most of the time, the Python script runs smoothly, but occasionally it gets stuck when creating a new chromedriver session. It's puzzling why this happens interm ...

Tips on verifying the presence of an element within the HTML with Selenium

My inquiry revolves around a specific process. I am tasked with locating an element on a webpage using its class, extracting and displaying its text, then splitting it into parts using the split() function. However, I encounter an error when the specified ...

Automate button clicking in Selenium WebDriver using Java with changing element IDs

1) A popup is displayed on my website with two options, Yes and No. 2) The IDs of these buttons keep changing dynamically. 3) How can I handle this scenario and click on the Yes button? 4) Both buttons, Yes and No, belong to the same classname which ...

ChromeDriverService and Azure Pipelines Agents

Currently, I am automating Selenium tests in an Azure DevOps pipeline using C#. To improve debugging, I recently updated my code to include ChromeDriver logs, requiring me to make changes to utilize the ChromeDriverService. string binaryDir = Manag ...