我尝试使用python连接HP QC来创建缺陷并附加文件,但我无法连接HP QC.这是我的代码:
domain='DEFAULT_773497139'
project='773497139_DEMO'
import requests
url = "https://almalm1250saastrial.saas.hpe.com/qcbin/"
querystring = {"username":"user@gmail.com","password":"password"}
headers = {
'cache-control': "no-cache",
'token': "5d33d0b7-1d04-4989-3349-3005b847ab7f"
}
response = requests.request("POST", url, headers=headers, params=querystring)
#~ print(response.text)
print response.headers
new_header = response.headers
new_url = url+ u'rest/domains/'+domain+u'/projects/'+project
new_querystring = {
"username":"user@gmail.com",
"password":"password",
"domain":'DEFAULT_773497139',
"project":'773497139_DEMO'
}
print new_url
response = requests.request("POST", new_url, headers=new_header, params=new_querystring)
print(response.text)
Run Code Online (Sandbox Code Playgroud)
现在登录工作正常,但是当尝试其他API请求时,我会收到以下消息:
Authentication failed. Browser based integrations - to login append '?login-form-required=y' to the url you tried to access
Run Code Online (Sandbox Code Playgroud)
如果已添加参数,则返回登录页面.
在工作中,一位同事将hp qc中的缺陷数据复制并粘贴到excel,这需要她的年龄......这让我很生气!
无论如何从hp qc导出数据到excel?它只需要转储缺陷列表及其相关字段,如Id,日期,摘要,分配给等等....
必须有一种方法可以导出到excel ...
我想使用Label of字段而不是名称来更新QC中的自定义用户字段
目前我们这样做
Set currentRun = QCUtil.CurrentRun
currentRun.Field("RN_USER_03") = 1
currentRun.Post
Run Code Online (Sandbox Code Playgroud)
但我想这样做
Set currentRun = QCUtil.CurrentRun
currentRun.Field("Data Rows Passed") = 4
currentRun.Post
Run Code Online (Sandbox Code Playgroud)
但我找不到这样做的方法.有任何想法吗?
我是REST的新手,我正在尝试开发一个Web应用程序,它将从一个sid(已经覆盖)和另一个HP的ALM连接到JIRA.
我现在正在尝试完成的是使用PHP对ALM进行基本身份验证,但似乎无法取得进展.
这是我的代码:
$handle=curl_init('http://192.168.1.7:8081');
$headers = array(
'Accept: application/xml',
'Content-Type: application/xml',
'Authorization: Basic YWRtaW46MTIzNA==',
);
$username='admin';
$password='1234';
$url = 'http://192.168.1.7:8081/qcbin/authentication-point/login.jsp';
curl_setopt_array(
$handle,
array(
CURLOPT_URL=>'http://192.168.1.7:8081/qcbin/rest/domains/default/projects/Ticomsoft/defects?login-form-required=y',
//CURLOPT_COOKIEFILE=>$ckfile,
CURLOPT_POST=>true,
//CURLOPT_HTTPGET =>true,
CURLOPT_COOKIEJAR=>$ckfile,
CURLOPT_VERBOSE=>1,
//CURLOPT_POSTFIELDS=>,
//CURLOPT_GETFIELDS=>'j_username=admin&j_password=1234&redirect-url=http://192.168.1.7:8081/myUiResource.jsps',
CURLOPT_SSL_VERIFYHOST=> 0,
CURLOPT_SSL_VERIFYPEER=> 0,
CURLOPT_RETURNTRANSFER=>true,
CURLOPT_FOLLOWLOCATION=>true,
CURLOPT_HEADER=>false,
CURLOPT_HTTPHEADER=> $headers,
CURLOPT_AUTOREFERER=>true
//CURLOPT_COOKIE=>
//CURLOPT_USERPWD=>"admin:yahala"
//CURLOPT_CUSTOMREQUEST=>"POST"
)
);
$result=curl_exec($handle);
$ch_error = curl_error($handle);
$response = curl_getinfo($handle);
print_r($response);
if ($ch_error) {
echo "cURL Error: $ch_error";
} else {
//var_dump(json_decode($result, true));
echo $result;
}
curl_close($handle);
?>
Run Code Online (Sandbox Code Playgroud)
你可以看到,随着我的试验和错误的进展,有很多垃圾.
我在C#中使用OTA API.
如果我有测试用例ID,如何在QC中找到测试.(按测试用例ID查找测试)测试可能出现在测试计划中的任何文件夹下(即在SUbject下).