iT邦幫忙

0

Selenium 結合Jmeter對Chrome進行自動化測試問題(已解決)

  • 分享至 

  • xImage

更: 剛剛發現115後版本提供方式有調整 最下方有提供chromedriver
https://googlechromelabs.github.io/chrome-for-testing/


目前使用Jmeter + Selenium在chrome上進行自動化測試,
但遇到一個driver不支援124版本Chrome的問題,想知道替代方案有哪些,怎麼去設置相關的config
不知道有沒有大大可以指點一下方向或是教學文章

附上查看的教學
https://www.baeldung.com/selenium-jmeter

附上錯誤訊息


2024-04-24 11:23:12,476 ERROR o.a.j.t.JMeterThread: Error calling threadStarted
org.openqa.selenium.SessionNotCreatedException: Could not start a new session. Response code 500. Message: session not created: This version of ChromeDriver only supports Chrome version 114
Current browser version is 124.0.6367.79 with binary path C:\Program Files\Google\Chrome\Application\chrome.exe 
Host info: host: 'DANNYCHANG', ip: '192.168.81.89'
Build info: version: '4.13.0', revision: 'ba948ece5b*'
System info: os.name: 'Windows 11', os.arch: 'amd64', os.version: '10.0', java.version: '17.0.8'
Driver info: org.openqa.selenium.chrome.ChromeDriver
Command: [null, newSession {capabilities=[Capabilities {acceptInsecureCerts: false, browserName: chrome, goog:chromeOptions: {args: [--remote-allow-origins=*, --start-maximized], extensions: []}, proxy: Proxy(autodetect)}]}]
	at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:140) ~[selenium-remote-driver-4.13.0.jar:?]
	at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:96) ~[selenium-remote-driver-4.13.0.jar:?]
	at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:68) ~[selenium-remote-driver-4.13.0.jar:?]
	at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:163) ~[selenium-remote-driver-4.13.0.jar:?]
	at org.openqa.selenium.remote.service.DriverCommandExecutor.invokeExecute(DriverCommandExecutor.java:196) ~[selenium-remote-driver-4.13.0.jar:?]
	at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:171) ~[selenium-remote-driver-4.13.0.jar:?]
	at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:602) ~[selenium-remote-driver-4.13.0.jar:?]
	at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:236) ~[selenium-remote-driver-4.13.0.jar:?]
	at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:163) ~[selenium-remote-driver-4.13.0.jar:?]
	at org.openqa.selenium.chromium.ChromiumDriver.<init>(ChromiumDriver.java:108) ~[selenium-chromium-driver-4.13.0.jar:?]
	at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:88) ~[selenium-chrome-driver-4.13.0.jar:?]
	at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:83) ~[selenium-chrome-driver-4.13.0.jar:?]
	at com.googlecode.jmeter.plugins.webdriver.config.ChromeDriverConfig.createBrowser(ChromeDriverConfig.java:28) ~[jmeter-plugins-webdriver-4.13.0.0.jar:?]
	at com.googlecode.jmeter.plugins.webdriver.config.ChromeDriverConfig.createBrowser(ChromeDriverConfig.java:14) ~[jmeter-plugins-webdriver-4.13.0.0.jar:?]
	at com.googlecode.jmeter.plugins.webdriver.config.WebDriverConfig.getPreparedBrowser(WebDriverConfig.java:221) ~[jmeter-plugins-webdriver-4.13.0.0.jar:?]
	at com.googlecode.jmeter.plugins.webdriver.config.WebDriverConfig.threadStarted(WebDriverConfig.java:152) ~[jmeter-plugins-webdriver-4.13.0.0.jar:?]
	at org.apache.jmeter.threads.JMeterThread$ThreadListenerTraverser.addNode(JMeterThread.java:802) [ApacheJMeter_core.jar:5.6.2]
	at org.apache.jorphan.collections.HashTree.traverseInto(HashTree.java:1029) [jorphan.jar:5.6.2]
	at org.apache.jorphan.collections.HashTree.traverse(HashTree.java:1012) [jorphan.jar:5.6.2]
	at org.apache.jmeter.threads.JMeterThread.threadStarted(JMeterThread.java:770) [ApacheJMeter_core.jar:5.6.2]
	at org.apache.jmeter.threads.JMeterThread.initRun(JMeterThread.java:758) [ApacheJMeter_core.jar:5.6.2]
	at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:264) [ApacheJMeter_core.jar:5.6.2]
	at java.lang.Thread.run(Thread.java:833) [?:?]
2024-04-24 11:23:12,477 ERROR o.a.j.t.JMeterThread: Error while processing sampler: 'jp@gc - WebDriver Sampler'.
java.lang.IllegalArgumentException: Browser has not been configured.  Please ensure at least 1 WebDriverConfig is created for a ThreadGroup.
	at com.googlecode.jmeter.plugins.webdriver.sampler.WebDriverSampler.sample(WebDriverSampler.java:65) ~[jmeter-plugins-webdriver-4.13.0.0.jar:?]
	at org.apache.jmeter.threads.JMeterThread.doSampling(JMeterThread.java:651) ~[ApacheJMeter_core.jar:5.6.2]
	at org.apache.jmeter.threads.JMeterThread.executeSamplePackage(JMeterThread.java:570) ~[ApacheJMeter_core.jar:5.6.2]
	at org.apache.jmeter.threads.JMeterThread.processSampler(JMeterThread.java:501) [ApacheJMeter_core.jar:5.6.2]
	at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:268) [ApacheJMeter_core.jar:5.6.2]
	at java.lang.Thread.run(Thread.java:833) [?:?]
圖片
  直播研討會
圖片
{{ item.channelVendor }} {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

尚未有邦友回答

立即登入回答