Hi Everyone, Did anyone tried executing UI tests from Jmeter using Webdriver sampler on jenkins or remote machine?
Issue: While trying to run Jmeter-Webdriver Sampler through Jmeter-Maven integration it fails to start browser and throwing this error. [*INFO] ChromeDriver was started successfully.* *[INFO] Uncaught Exception java.lang.NoSuchMethodError: org.openqa.selenium.chrome.ChromeDriver.<init>(Lorg/openqa/selenium/chrome/ChromeDriverService;Lorg/openqa/selenium/Capabilities;)V in thread Thread[PJ API + UI Tests 2-1,5,main]. See log file for details.* Complete Log: java.lang.NoSuchMethodError: org.openqa.selenium.chrome.ChromeDriver.<init>(Lorg/openqa/selenium/chrome/ChromeDriverService;Lorg/openqa/selenium/Capabilities;)V at com.googlecode.jmeter.plugins.webdriver.config.ChromeDriverConfig.createBrowser(ChromeDriverConfig.java:83) ~[jmeter-plugins-webdriver-3.3.jar:?] at com.googlecode.jmeter.plugins.webdriver.config.ChromeDriverConfig.createBrowser(ChromeDriverConfig.java:21) ~[jmeter-plugins-webdriver-3.3.jar:?] at com.googlecode.jmeter.plugins.webdriver.config.WebDriverConfig.getPreparedBrowser(WebDriverConfig.java:234) ~[jmeter-plugins-webdriver-3.3.jar:?] at com.googlecode.jmeter.plugins.webdriver.config.WebDriverConfig.threadStarted(WebDriverConfig.java:221) ~[jmeter-plugins-webdriver-3.3.jar:?] at org.apache.jmeter.threads.JMeterThread$ThreadListenerTraverser.addNode(JMeterThread.java:797) ~[ApacheJMeter_core-5.5.jar:5.5] at org.apache.jorphan.collections.HashTree.traverseInto(HashTree.java:993) ~[jorphan-5.5.jar:5.5] at org.apache.jorphan.collections.HashTree.traverse(HashTree.java:976) ~[jorphan-5.5.jar:5.5] at org.apache.jmeter.threads.JMeterThread.threadStarted(JMeterThread.java:765) ~[ApacheJMeter_core-5.5.jar:5.5] at org.apache.jmeter.threads.JMeterThread.initRun(JMeterThread.java:753) ~[ApacheJMeter_core-5.5.jar:5.5] at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:264) ~[ApacheJMeter_core-5.5.jar:5.5] at java.lang.Thread.run(Thread.java:834) ~[?:?] However Interesting thing is, same script is working fine when we execute from Jmeter UI. So issue is only when we use Jmeter Maven plugin to download dependencies and execute them. I have attached my sample POM file, in case any specific dependency is missing. Looking forward to hear from you. Thanks, Divyang Raval
<?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <artifactId>Performance_Test</artifactId> <groupId>com.lazerycode.jmeter</groupId> <version>3.6.0</version> <packaging>pom</packaging> <description>Executes Performance Tests for API and UI</description> <build> <plugins> <plugin> <groupId>com.lazerycode.selenium</groupId> <artifactId>driver-binary-downloader-maven-plugin</artifactId> <version>1.0.18</version> <configuration> <rootStandaloneServerDirectory>${project.basedir}/src/test/jmeter</rootStandaloneServerDirectory> <customRepositoryMap>repo.xml</customRepositoryMap> <onlyGetDriversForHostOperatingSystem>true</onlyGetDriversForHostOperatingSystem> <!-- If set to false will download every version available (Other filters will be taken into account --> <onlyGetLatestVersions>true</onlyGetLatestVersions> <overwriteFilesThatExist>true</overwriteFilesThatExist> <getSpecificExecutableVersions> <googlechrome>103</googlechrome> </getSpecificExecutableVersions> <!-- Check file hashes of downloaded files. Default: true --> <checkFileHashes>true</checkFileHashes> <!-- auto detect system proxy to use when downloading files --> <!-- To specify an explicit proxy set the environment variables http.proxyHost and http.proxyPort --> <useSystemProxy>true</useSystemProxy> </configuration> <executions> <execution> <goals> <goal>selenium</goal> </goals> </execution> </executions> </plugin> <plugin> <groupId>${project.groupId}</groupId> <artifactId>jmeter-maven-plugin</artifactId> <version>${project.version}</version> <!-- configure different executions of the plugin --> <executions> <execution> <id>configuration</id> <goals> <goal>configure</goal> </goals> <configuration> </configuration> </execution> <execution> <!--Run Jmeter tests --> <id>jmeter-test</id> <goals> <goal>jmeter</goal> </goals> </execution> <!-- Fail build on errors in test --> <execution> <id>jmeter-check-results</id> <goals> <goal>results</goal> </goals> </execution> </executions> <configuration> <!-- configure which testplans to use --> <testFilesIncluded>PerfTest.jmx</testFilesIncluded> <resultsDirectory>${project.basedir}/target/jmeter/results/</resultsDirectory> <generateReports>true</generateReports> <testResultsTimestamp>false</testResultsTimestamp> <reportDirectory>${project.basedir}/target/jmeter/results/</reportDirectory> <jmeterExtensions> <artifact>kg.apc:jmeter-plugins-webdriver:jar:3.3</artifact> </jmeterExtensions> <propertiesUser> <projectDir>${project.basedir}</projectDir> </propertiesUser> <ignoreResultFailures>true</ignoreResultFailures> </configuration> </plugin> </plugins> </build> <dependencies> <dependency> <groupId>org.apache.jmeter</groupId> <artifactId>ApacheJMeter_core</artifactId> </dependency> <dependency> <groupId>kg.apc</groupId> <artifactId>jmeter-plugins-tst</artifactId> </dependency> <dependency> <groupId>kg.apc</groupId> <artifactId>jmeter-plugins-casutg</artifactId> </dependency> <!-- https://mvnrepository.com/artifact/kg.apc/jmeter-plugins-webdriver --> <dependency> <groupId>kg.apc</groupId> <artifactId>jmeter-plugins-webdriver</artifactId> </dependency> </dependencies> <dependencyManagement> <dependencies> <dependency> <groupId>org.apache.jmeter</groupId> <artifactId>ApacheJMeter_core</artifactId> <version>5.5</version> </dependency> <dependency> <groupId>kg.apc</groupId> <artifactId>jmeter-plugins-tst</artifactId> <version>2.5</version> </dependency> <dependency> <groupId>kg.apc</groupId> <artifactId>jmeter-plugins-casutg</artifactId> <version>2.10</version> </dependency> <!-- https://mvnrepository.com/artifact/kg.apc/jmeter-plugins-webdriver --> <dependency> <groupId>kg.apc</groupId> <artifactId>jmeter-plugins-webdriver</artifactId> <version>3.3</version> </dependency> <!-- https://mvnrepository.com/artifact/org.apache.httpcomponents/httpclient --> <dependency> <groupId>org.apache.httpcomponents</groupId> <artifactId>httpclient</artifactId> <version>4.5.13</version> </dependency> </dependencies> </dependencyManagement> <!-- in case we want to use a SNAPSHOT version of the jmeter-maven-plugin --> <pluginRepositories> <pluginRepository> <id>sonatype-snapshots</id> <url>https://oss.sonatype.org/content/repositories/snapshots/</url> </pluginRepository> </pluginRepositories> </project>
--------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
