我有一个应用程序,它使用我的Windows域凭据自动登录 . 我在Jmeter中尝试了下面的内容 .
HTTP请求HTTP标头管理器(使用基本编码字符串进行授权)
我收到以下响应响应代码:500响应消息:内部服务器错误
我能够在浏览器上查看内容 . 我尝试使用java代码,如下所示
CookieHandler.setDefault(new CookieManager(null, CookiePolicy.ACCEPT_ALL));
Authenticator.setDefault(new MyAuthenticator("username", "password"));
URL url = new URL("http://someurl");
HttpURLConnection connection = (HttpURLConnection)url.openConnection();
System.out.println(connection.getResponseCode());
System.out.println(connection.getResponseMessage());
这给了我200 OK响应 .
请告诉我如何通过Jmeter实现这一目标 . 提前致谢!
1 回答
尝试在您的jmeter测试套件中添加HTTP授权管理器并在那里输入您的凭据 . 这可能会解决您的问题