

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
Timeout running testset using OTA api
Hi
I have written a program that will using the ALM OTA Api start an execution of a test set and then download the result and convert it to HTML report. This works fine in most cases but when a test set contains a test that takes longer than ALM disconnect timeout the execution of the test will finish but ALM marks the test as "Not compeleted" with execution time set to 0.
My code looks something like this
In my testsetrunner class I first get the testset from alm, then wait for it to complete. On the next call to GetTestSet after the run I get exception that ALM connection timed out.
var testset = _repository.GetTestSet(ts.Id);
_repository.StartExecutionAndWaitForComplete(ts.Id);
var afterRunTestSet = _repository.GetTestSet(ts.Id);
public void StartExecutionAndWaitForComplete(int id)
{
var testSetFactory = ALM().TestSetFactory;
var testset = testSetFactory[id];
_scheduler = testset.StartExecution("");
_scheduler.RunAllLocally = true;
_scheduler.Run();
var execstatus = _scheduler.ExecutionStatus;
var finished = false;
while (!finished)
{
execstatus.RefreshExecStatusInfo("all", true);
finished = execstatus.Finished();
ALM().RefreshConnectionState();
Thread.Sleep(5000);
}
}
// And the ALM function looks like this
private TDConnection ALM()
{
if (_alm == null)
{
_alm = new TDConnection();
}
_alm.RefreshConnectionState();
if (!_alm.Connected)
{
_alm.InitConnectionEx(GetUrl());
}
if (!_alm.LoggedIn)
{
_alm.ConnectProjectEx(DataStorage.Instance.ParameterDomain, DataStorage.Instance.ParameterProject,
DataStorage.Instance.ParameterUser, DataStorage.Instance.ParameterPassword);
}
return _alm;
}


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
Hi,
Could you tell us what version and patch level of ALM are you running?
If you find that this or any post resolves your issue, please be sure to mark it as an accepted solution


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
hi
HP Application Lifecycle Management
Product version 11.52.496 Patch level 2
But I have also tried in our next version which is
Product version: 12.20

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
Hi,
You need to change the EAIT_BEFORE_DISCONNECT to a higher time. It's the only way to avoid the issue.


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
Ok, thanks.. That is unfortunate though since we have it low for a reason