我正在尝试在 blazemeter 中运行我的 Jmeter webdriver 脚本,但由于未找到元素,测试失败。本地元素仅在 blazemeter 中正确找到它失败了,为什么?我的 Jmeter 脚本截图
下面是从 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
我们可以说这是因为它无法找到元素。但它在本地工作,我也尝试改变元素,但没有奏效。