为什么在 Jmeter 中运行相同的 jmeter selenium 脚本时 blazemeter 会出错?
Why blazemeter giving error when the same jmeter selenium script runs in Jmeter?
我正在尝试 运行 我在 blazemeter 中的 Jmeter webdriver 脚本,但由于未找到元素,测试失败。本地元素只能在 blazemeter 中正确找到,为什么会失败? My Jmeter script screenshot
以下是 blazemeter 生成的日志
2017-11-29 05:00:08,924 INFO BlazeMeter: BlazeMeter startup script completed
2017-11-29 05:00:09,780 INFO o.a.j.JMeter: Running test (1511931609780)
2017-11-29 05:00:09,862 INFO o.a.j.e.StandardJMeterEngine: Starting ThreadGroup: 1 : FacebookThread
2017-11-29 05:00:09,863 INFO o.a.j.e.StandardJMeterEngine: Starting 1 threads for group FacebookThread.
2017-11-29 05:00:09,863 INFO o.a.j.e.StandardJMeterEngine: Thread will continue on error
2017-11-29 05:00:09,863 INFO o.a.j.t.ThreadGroup: Starting thread group... number=1 threads=1 ramp-up=14 perThread=14000.0 delayedStart=false
2017-11-29 05:00:09,870 INFO o.a.j.t.ThreadGroup: Started thread group number 1
2017-11-29 05:00:09,870 INFO o.a.j.e.StandardJMeterEngine: All thread groups have been started
2017-11-29 05:00:09,874 INFO o.a.j.t.JMeterThread: Thread started: FacebookThread 1-1
2017-11-29 05:02:16,311 ERROR c.g.j.p.w.s.WebDriverSampler: Sourced file: inline evaluation of: ``import org.apache.jmeter.services.FileServer; import org.openqa.selenium; import . . . '' : Method Invocation wait.until : at Line: 19 : in file: inline evaluation of: ``import org.apache.jmeter.services.FileServer; import org.openqa.selenium; import . . . '' : wait .until ( ExpectedConditions .visibilityOfElementLocated ( By .xpath ( "//tr/td/input[@id='email']" ) ) )
Target exception: org.openqa.selenium.TimeoutException: Timed out after 100 seconds waiting for visibility of element located by By.xpath: //tr/td/input[@id='email']
Build info: version: '2.52.0', revision: '4c2593cfc3689a7fcd7be52549167e5ccc93ad28', time: '2016-02-11 11:22:43'
System info: host: 'r-v3-5a1e3e8aa6afc-0-c', ip: '10.240.0.9', os.name: 'Linux', os.arch: 'amd64', os.version: '4.4.0-96-generic', java.version: '1.8.0_141'
Driver info: org.openqa.selenium.firefox.FirefoxDriver
Capabilities [{applicationCacheEnabled=true, rotatable=false, handlesAlerts=true, databaseEnabled=true, version=28.0, platform=LINUX, browserConnectionEnabled=true, nativeEvents=false, acceptSslCerts=true, webStorageEnabled=true, locationContextEnabled=true, browserName=firefox, takesScreenshot=true, javascriptEnabled=true, cssSelectorsEnabled=true}]
Session ID: 29d6d16b-619e-4ddc-a7b0-6c7c053ae36e
in inline evaluation of: ``import org.apache.jmeter.services.FileServer; import org.openqa.selenium; import . . . '' at line number 19
2017-11-29 05:02:16,373 INFO o.a.j.t.JMeterThread: Thread is done: FacebookThread 1-1
2017-11-29 05:02:16,374 INFO o.a.j.t.JMeterThread: Thread finished: FacebookThread 1-1
2017-11-29 05:02:16,483 INFO o.a.j.e.StandardJMeterEngine: Notifying test listeners of end of test
2017-11-29 05:02:29,525 INFO o.a.j.JMeter: Command: Shutdown received from /127.0.0.1
2017-11-29 05:02:30,640 INFO o.a.j.JMeter: Command: StopTestNow received from /127.0.0.1
可以说是因为找不到元素。但它在本地工作,我也尝试更改元素但它没有工作。
我的期望是 Selenium 2.52.0 doesn't work correctly with Firefox 28 所以您应该将您的 Selenium Java 客户端库降级到 2.41.0 或将 Firefox 升级到 45.0
我还认为您应该向 BlazeMeter Support 提出这个问题,因为他们应该有更多关于其基础架构的信息,并且能够建议解决您的问题的最佳方法。
另请注意 starting JMeter 3.1 it is recommended to use Groovy language for any form of scripting so consider switching to Groovy on next available opportunity. See Apache Groovy - Why and How You Should Use It 文章,了解有关为什么 Groovy 是更好的脚本选项的更多信息
我正在尝试 运行 我在 blazemeter 中的 Jmeter webdriver 脚本,但由于未找到元素,测试失败。本地元素只能在 blazemeter 中正确找到,为什么会失败? My Jmeter script screenshot
以下是 blazemeter 生成的日志
2017-11-29 05:00:08,924 INFO BlazeMeter: BlazeMeter startup script completed
2017-11-29 05:00:09,780 INFO o.a.j.JMeter: Running test (1511931609780)
2017-11-29 05:00:09,862 INFO o.a.j.e.StandardJMeterEngine: Starting ThreadGroup: 1 : FacebookThread
2017-11-29 05:00:09,863 INFO o.a.j.e.StandardJMeterEngine: Starting 1 threads for group FacebookThread.
2017-11-29 05:00:09,863 INFO o.a.j.e.StandardJMeterEngine: Thread will continue on error
2017-11-29 05:00:09,863 INFO o.a.j.t.ThreadGroup: Starting thread group... number=1 threads=1 ramp-up=14 perThread=14000.0 delayedStart=false
2017-11-29 05:00:09,870 INFO o.a.j.t.ThreadGroup: Started thread group number 1
2017-11-29 05:00:09,870 INFO o.a.j.e.StandardJMeterEngine: All thread groups have been started
2017-11-29 05:00:09,874 INFO o.a.j.t.JMeterThread: Thread started: FacebookThread 1-1
2017-11-29 05:02:16,311 ERROR c.g.j.p.w.s.WebDriverSampler: Sourced file: inline evaluation of: ``import org.apache.jmeter.services.FileServer; import org.openqa.selenium; import . . . '' : Method Invocation wait.until : at Line: 19 : in file: inline evaluation of: ``import org.apache.jmeter.services.FileServer; import org.openqa.selenium; import . . . '' : wait .until ( ExpectedConditions .visibilityOfElementLocated ( By .xpath ( "//tr/td/input[@id='email']" ) ) )
Target exception: org.openqa.selenium.TimeoutException: Timed out after 100 seconds waiting for visibility of element located by By.xpath: //tr/td/input[@id='email']
Build info: version: '2.52.0', revision: '4c2593cfc3689a7fcd7be52549167e5ccc93ad28', time: '2016-02-11 11:22:43'
System info: host: 'r-v3-5a1e3e8aa6afc-0-c', ip: '10.240.0.9', os.name: 'Linux', os.arch: 'amd64', os.version: '4.4.0-96-generic', java.version: '1.8.0_141'
Driver info: org.openqa.selenium.firefox.FirefoxDriver
Capabilities [{applicationCacheEnabled=true, rotatable=false, handlesAlerts=true, databaseEnabled=true, version=28.0, platform=LINUX, browserConnectionEnabled=true, nativeEvents=false, acceptSslCerts=true, webStorageEnabled=true, locationContextEnabled=true, browserName=firefox, takesScreenshot=true, javascriptEnabled=true, cssSelectorsEnabled=true}]
Session ID: 29d6d16b-619e-4ddc-a7b0-6c7c053ae36e
in inline evaluation of: ``import org.apache.jmeter.services.FileServer; import org.openqa.selenium; import . . . '' at line number 19
2017-11-29 05:02:16,373 INFO o.a.j.t.JMeterThread: Thread is done: FacebookThread 1-1
2017-11-29 05:02:16,374 INFO o.a.j.t.JMeterThread: Thread finished: FacebookThread 1-1
2017-11-29 05:02:16,483 INFO o.a.j.e.StandardJMeterEngine: Notifying test listeners of end of test
2017-11-29 05:02:29,525 INFO o.a.j.JMeter: Command: Shutdown received from /127.0.0.1
2017-11-29 05:02:30,640 INFO o.a.j.JMeter: Command: StopTestNow received from /127.0.0.1
可以说是因为找不到元素。但它在本地工作,我也尝试更改元素但它没有工作。
我的期望是 Selenium 2.52.0 doesn't work correctly with Firefox 28 所以您应该将您的 Selenium Java 客户端库降级到 2.41.0 或将 Firefox 升级到 45.0
我还认为您应该向 BlazeMeter Support 提出这个问题,因为他们应该有更多关于其基础架构的信息,并且能够建议解决您的问题的最佳方法。
另请注意 starting JMeter 3.1 it is recommended to use Groovy language for any form of scripting so consider switching to Groovy on next available opportunity. See Apache Groovy - Why and How You Should Use It 文章,了解有关为什么 Groovy 是更好的脚本选项的更多信息