【问题标题】:Unable to fetch data from test rail using java无法使用 java 从测试轨道获取数据
【发布时间】:2017-05-10 09:31:25
【问题描述】:

我正在使用 Test rail 提供的 API 来使用 java 提取信息。 下面是我的程序。

APIClient 客户端 = new APIClient("https://test.testrail.net/index.php?/runs/view/154"); 客户端.setUser("..");

client.setPassword("..");

JSONObject c = (JSONObject) client.sendGet("get_case/T54757");
System.out.println(c);

我下载了API并调用了上面提到的方法。但是每次json响应都返回null。 有人可以帮忙吗?

【问题讨论】:

  • 你手动尝试过点击api吗?那你有结果吗?
  • 没有@kushal。我还没试过。
  • 尝试分享...
  • 我以这种格式发出请求 GET index.php?/api/v2/get_case/:case_id test.testrail.net/index.php?/runs/view/154/get_case/T54552 它说“未授权”。可能是我做错了什么。
  • 是的,问题出在您的 api 调用中

标签: java selenium testing testrail


【解决方案1】:

根据 TestRail API V2- 需要使用 TYPE= Basic Authentication and UserName= and Password=

出于安全原因,强烈建议启用 API 密钥并在使用代码访问时使用它。整个 API 调用集合,对我来说工作正常。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2018-12-24
    • 2017-06-15
    • 2013-02-22
    • 1970-01-01
    • 2022-10-20
    • 1970-01-01
    • 1970-01-01
    • 2015-10-02
    相关资源
    最近更新 更多