Jmeter/selenium-如何访问特定端点
我在应用程序中有一个简单的性能测试流。
- 登录过程
- 1
- Process2
- Process3
- 注销
我正在使用Jmeter/Selenium进行性能测试。我目前正在调试Process3(“/示例/路径”)中的端点。问题在于,我必须运行整个自动化,才能在Process3中到达该端点。有没有办法跳过过程并导航到该特定端点(不是无头)?例如:
WDS.sampleResult.sampleStart();
WDS.browser.get("https://domain/path/path/endpoint");
//Authentication
implicitFind(pkg.By.id("username")).sendKeys("user");
implicitFind(pkg.By.id("password")).sendKeys("password");
implicitFind(pkg.By.id("login")).click();
//below code would be for debugging endpoint in UI
当我运行WebDriver采样器时,它会显示登录页面,我不介意要求登录。但是,在我登录后,WebApp不会转到端点并抛出NullPoInterException。我需要添加cookie经理吗?如果是这样,我该如何使用WebDriver采样器进行此操作。如果没有,是否有另一种成功实现这一目标的方法?提前致谢。
I have a simple performance test flow in an application.
- Login
- Process1
- Process2
- Process3
- Logout
I am using Jmeter/Selenium to do a performance testing. I am currently debugging an endpoint in Process3("/example/path"). The problem is that I have to run the entire automation for me to get to that endpoint in Process3. Is there a way to skip the processes and navigate to that specific endpoint(not headless)? For example:
WDS.sampleResult.sampleStart();
WDS.browser.get("https://domain/path/path/endpoint");
//Authentication
implicitFind(pkg.By.id("username")).sendKeys("user");
implicitFind(pkg.By.id("password")).sendKeys("password");
implicitFind(pkg.By.id("login")).click();
//below code would be for debugging endpoint in UI
When I run WebDriver Sampler, it presents the login page, which I do not mind asking to login. But after I login, webapp does not go to endpoint and throws a NullPointerException. Would I need to add a Cookie Manager? If so, how would I go with doing this using a WebDriver Sampler. If no, is there another way to successfully achieve this? Thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果应用程序在登录后不能正确地将您重定向到“端点” - 仅是您的应用程序问题,那么您在Jmeter或硒级别上无能为力。
您需要仅运行进程3并跳过过程1和进程2仅使用“禁用”或“切换”上下文菜单操作暂时禁用它们,
您可以看到“灰色”采样器不在执行。
htttp cookie Manager a href =“ https://jmeter.apache.org/usermanual/component_reference.html#http_request” rel =“ nofollow noreferrer”> http request 样本采样器, https://www.selenium.dev/ 是一个浏览器自动化框架,浏览器cookie自动
If the application doesn't properly redirect you to the "endpoint" after logging in - it's your application problem only, there is nothing you can do about it on JMeter or Selenium level.
It you want to run Process 3 only and skip Process 1 and Process 2 just temporarily disable them using "Disable" or "Toggle" context menu actions
As you can see the "greyed out" samplers are not executed.
HTTP Cookie Manager relates only to HTTP Request samplers, https://www.selenium.dev/ is a browser automation framework and browsers handle cookies automatically