SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 5 of 5
  1. #1
    Junior Member
    Join Date
    Jul 2009
    Posts
    6
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    QA Director 05.03.01, Scripts from QARun 04.09.01

    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

  2. #2
    Junior Member
    Join Date
    Jul 2009
    Posts
    6
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: QA Director 05.03.01, Scripts from QARun 04.09.01

    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

  3. #3
    Senior Member
    Join Date
    Jun 2002
    Location
    farmington hills, MI, US
    Posts
    713
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: QA Director 05.03.01, Scripts from QARun 04.09.01

    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.

  4. #4
    Junior Member
    Join Date
    Jul 2009
    Posts
    6
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: QA Director 05.03.01, Scripts from QARun 04.09.01

    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).ToSt ring());
    }
    }
    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 não 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();
    }
    }
    }
    }

  5. #5
    Junior Member
    Join Date
    Jul 2009
    Posts
    6
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: QA Director 05.03.01, Scripts from QARun 04.09.01

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

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Search Engine Optimisation provided by DragonByte SEO v2.0.36 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Resources saved on this page: MySQL 11.54%
vBulletin Optimisation provided by vB Optimise v2.6.4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.2.8 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominate (Lite) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Feedback Buttons provided by Advanced Post Thanks / Like (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Username Changing provided by Username Change (Free) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
BetaSoft Inc.
Digital Point modules: Sphinx-based search
All times are GMT -8. The time now is 02:30 AM.

Copyright BetaSoft Inc.