The online community for software testing & quality assurance professionals
 
 
Calendar   Today's Topics
Sponsors:




Lost Password?

Home
BetaSoft
Blogs
Jobs
Training
News
Links
Downloads



Testing Tools >> Micro Focus/Compuware QARun

Pages: 1
airtobs
Newbie


Reged: 07/30/09
Posts: 6
QA Director 05.03.01, Scripts from QARun 04.09.01
      #583076 - 07/30/09 04:03 AM

Hi,

I have, more or less, 1000 automated QARun test scripts in several MS Access databases and I'm trying to use them through QADirector 05.03.01. My problems are as follows:

- I use a single Test Procedure for each of my databases, which was the fastest way to import them to QADirector. When I run one of the Test Procedures ( with several QARun scripts) I get a detail of the results and the chance to either 'Rerun All' or to 'Rerun Failed'. Pressing 'Rerun Failed' all the Scripts in the Test Procedure will run not just the ones that failed. Is this a feature, or else how can I 'Rerun' only the failed?

- If a Test Procedure is the 'atom' in QADirector, is there anyway to import the Scripts in batch mode, going each of the scripts to each Test Procedure? Doing it one by one is nearly impossible because they are so many.

Thanks in advance, hope someone can help me...
Airtobs


Post Extras: Print Post   Remind Me!   Notify Moderator  
airtobs
Newbie


Reged: 07/30/09
Posts: 6
Re: QA Director 05.03.01, Scripts from QARun 04.09.01 [Re: airtobs]
      #583395 - 07/31/09 08:14 AM

According to Micro Focus this batched insertion of scripts it's not possible and I have to have a Test Procedure for each script or else I'll be running every test every time...

Thanks anyway,
Airtobs

PS - Come again in 20 days time maybe I'll find a solution


Post Extras: Print Post   Remind Me!   Notify Moderator  
chiefwiggum
Active Member


Reged: 06/03/02
Posts: 713
Loc: farmington hills, MI, US
Re: QA Director 05.03.01, Scripts from QARun 04.09.01 [Re: airtobs]
      #584564 - 08/07/09 08:41 AM

While I don't use QAD that much and it's been a long time since I used it with QARun, I thought that the parallel execution feature in QAD allowed for this. I'm probably wrong but it would make sense if you are pushing out jobs to multiple machines that you would only want to execute the ones that failed again on those machines and not the entire thing.

Post Extras: Print Post   Remind Me!   Notify Moderator  
airtobs
Newbie


Reged: 07/30/09
Posts: 6
Re: QA Director 05.03.01, Scripts from QARun 04.09.01 [Re: chiefwiggum]
      #589686 - 09/08/09 04:24 AM

After importing the scripts using the QA Director tool domain I kept the identifiers to use in this little C# program written in a C fashion. The numbers in it are the ones I've used not the ones you should use. You should use whatever numbers are in the database.
It was done to be fast and it worked.

using System;
using System.Collections.Generic;
using System.Text;
using System.Data.Sql;
using System.Data.SqlClient;


namespace CriaProceduresQAD
{
class Program
{
static int TestId;
static void selectTestScripts(SqlConnection conn, List<string> listScriptsDefnIds)
{
SqlCommand command = new SqlCommand();
SqlDataReader dataReader;

command.CommandType = System.Data.CommandType.Text;
command.CommandText = "select ScriptDefnId, ProjectId from QAC_QAD_ScriptDefns where ProjectId=111 and ScriptDefnId > 1703";
command.Connection = conn;

try
{
dataReader = command.ExecuteReader();
try
{
for (dataReader.Read(); dataReader.Read() != false; )
{
listScriptsDefnIds.Add(dataReader.GetInt32(0).ToString());
}
}
catch ( Exception ex)
{
Console.WriteLine( ex.Message);
}
finally
{
dataReader.Close();
}
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
}

}

static string apanhaScriptName( SqlConnection conn , int scriptId)
{
SqlCommand command = new SqlCommand();
SqlDataReader dataReader;
string scriptName="";

try
{
command.Connection = conn;
command.CommandType = System.Data.CommandType.Text;
command.CommandText = "select ScriptDefnId, Name from QAC_QAD_ScriptDefns where ScriptDefnId = " + scriptId.ToString();
dataReader = command.ExecuteReader();
dataReader.Read();

if (dataReader.HasRows)
scriptName = dataReader.GetString(1);

dataReader.Close();
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
}
return scriptName;
}

static void criaTestAttributes(SqlConnection conn, int testDefndId)
{
SqlCommand command = new SqlCommand();
int attributeId = 99;
string linhaEscrever;

try
{
command.Connection = conn;
command.CommandType = System.Data.CommandType.Text;

for (int i = 0; i < 4; i++)
{
attributeId++;

linhaEscrever = string.Format("{0}{1}{2}{3}{4}", "Insert Into QAC_QAD_TestAttributes ( TestDefnId, AttributeId) Values (", testDefndId.ToString(), ", ", attributeId.ToString(), ")");
command.CommandText = linhaEscrever;

Console.WriteLine(linhaEscrever);
command.ExecuteNonQuery();
}
linhaEscrever = string.Format("{0}{1}{2}{3}{4}", "Insert Into QAC_QAD_TestAttributes ( TestDefnId, AttributeId, Avalue) Values (", testDefndId.ToString(), ", ", (++attributeId).ToString(), ", 'Unwritten')");
command.CommandText = linhaEscrever;
Console.WriteLine(linhaEscrever);
command.ExecuteNonQuery();

}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
}

}

static void criaTestRules(SqlConnection conn, int testDefndId)
{
SqlCommand command = new SqlCommand();
string linhaEscrever;

try
{
command.Connection = conn;
command.CommandType = System.Data.CommandType.Text;

linhaEscrever = string.Format("{0}{1}{2}", "Insert Into QAC_QAD_TestRules ( TestDefnId, OrderNo, Type, Command, ExpectedExitStatus, IgnoreExitStatus, Timeout, Scope) Values (", testDefndId.ToString(), ", 0, 1, 'qc_run_scripts', 0, 0, 60, 0)");
command.CommandText = linhaEscrever;
Console.WriteLine(linhaEscrever);
command.ExecuteNonQuery();

}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
}
}

static void criaTestRelation( SqlConnection conn, int testDefnId)
{
SqlCommand command = new SqlCommand();
string linhaEscrever;

try
{
command.Connection = conn;
command.CommandType = System.Data.CommandType.Text;

linhaEscrever = string.Format("{0}{1}{2}{3}{4}{5}{6}", "Insert Into QAC_QAD_TestRelation ( ProjectID, TestID, TestDefnID, ParentTestID, ParentTestDefnID, Position, FixedID, SuiteID, TreeLevel, ParentPath) Values (111, ", (++TestId).ToString(), ", ", testDefnId.ToString(),", 0, 0, 0, 0, 0, 1, '", TestId.ToString(), ">')" );
command.CommandText = linhaEscrever;
Console.WriteLine(linhaEscrever);
command.ExecuteNonQuery();

linhaEscrever = string.Format("{0}{1}{2}{3}{4}{5}{6}", "Insert Into QAC_QAD_TestRelation ( ProjectID, TestID, TestDefnID, ParentTestID, ParentTestDefnID, Position, FixedID, SuiteID, TreeLevel, ParentPath) Values (111, ", (++TestId).ToString(), ", ", testDefnId.ToString(),", 383, 211, 1, 0, 100, 2, '383>", TestId.ToString(), ">')" );
command.CommandText = linhaEscrever;
Console.WriteLine(linhaEscrever);
command.ExecuteNonQuery();

}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
}
}

static void associaTestScripts(SqlConnection conn, int testDefndId, string scriptDefnId)
{
SqlCommand command = new SqlCommand();
string linhaEscrever;

try
{
command.Connection = conn;
command.CommandType = System.Data.CommandType.Text;

linhaEscrever = string.Format("{0}{1}{2}{3}{4}", "Insert Into QAC_QAD_TestScripts ( ProjectID, TestDefnID, ScriptDefnID, SelectedToRun, Position) Values (111, ", testDefndId.ToString(), ", ", scriptDefnId, ", 1, 0)" );
command.CommandText = linhaEscrever;
Console.WriteLine(linhaEscrever);
command.ExecuteNonQuery();
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
}
}

static void criaTestDefns(SqlConnection conn, List<string> listTestScripts)
{
SqlCommand command = new SqlCommand();
int testDefndId = 10699;
string linhaEscrever;
string scriptNumber = "";
string scriptName = "";

TestId = 3081;

List<string>.Enumerator listKeys;

try
{
command.Connection = conn;
command.CommandType = System.Data.CommandType.Text;

// conn.BeginTransaction();

listKeys = listTestScripts.GetEnumerator();
listKeys.MoveNext();

for (int i = 1; i <= listTestScripts.Count; i++, listKeys.MoveNext())
{
testDefndId += 1;

scriptNumber = listKeys.Current;

scriptName = apanhaScriptName(conn, Convert.ToInt32(scriptNumber));

linhaEscrever = string.Format("{0}{1}{2}{3}{4}{5}{6}{7}{8}{9}", "Insert Into QAC_QAD_TestDefns (ProjectId, SuiteId, TestDefnId, IsClass, IsSuiteClass, IsGlobal, HasDirectory, Name, Manual, Platforms, ExpectedResult, ParallelChildren, ExecRestrictions, VersionNum, IsOnline, AbortTestOnScriptFail, BindRules, CreatedByUserId, OwnerUserId, SavedParallel, ApplyToSubTest, DateCreated) Values (", "111, 0, ", testDefndId.ToString(), ", 0, 0, 0, 0,'", string.Format("{0}{1}", scriptName, "_V7"), "', 0, 'All Win32', 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, '", DateTime.Now.Month + "/" + DateTime.Now.Day + "/" + DateTime.Now.Year, " ", DateTime.Now.ToLongTimeString(), "')");

command.CommandText = linhaEscrever;

Console.WriteLine(linhaEscrever);
command.ExecuteNonQuery();

criaTestAttributes(conn, testDefndId);

criaTestRules( conn, testDefndId);

criaTestRelation( conn, testDefndId);

associaTestScripts(conn, testDefndId, listKeys.Current);

//falta qualquer coisa que s tou criar a procedure e no a lhe tou a dar nenhum teste
}



}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
}
}





static void Main(string[] args)
{
SqlConnection conn;
string linhaImprimir;
conn = new SqlConnection();
//Dictionary<string,string> dicValues = new Dictionary<string,string>();
List<string> listScriptsDefnIds = new List<string>();


try
{
conn.ConnectionString = "Data Source=Airtobs2003AS;Initial Catalog=CARS_WB;Uid=sa;Pwd=sa;";
conn.Open();

selectTestScripts(conn, listScriptsDefnIds);

criaTestDefns(conn, listScriptsDefnIds);

}
catch (Exception ex)
{
Console.WriteLine(ex.ToString());
}
finally
{
conn.Close();
}
}
}
}


Post Extras: Print Post   Remind Me!   Notify Moderator  
airtobs
Newbie


Reged: 07/30/09
Posts: 6
Re: QA Director 05.03.01, Scripts from QARun 04.09.01 [Re: airtobs]
      #589707 - 09/08/09 06:19 AM

Beware with the boundaries as I believe I'm missing the first of the list.

Post Extras: Print Post   Remind Me!   Notify Moderator  
Pages: 1



Extra information
0 registered and 1 anonymous users are browsing this forum.

Moderator:  Jim Brennan, AJ, DSquared 

Print Topic

Forum Permissions
      You cannot start new topics
      You cannot reply to topics
      HTML is disabled
      UBBCode is enabled

Rating:
Topic views: 5293

Rate this topic

Jump to

Contact Us | Privacy statement SQAForums

Powered by UBB.threads™ 6.5.5