Hi Hemant,_Question 1_:你可以通过1个testplan运行1个testplan。
但是,您应该在使用object.Testplan.State加载第二个测试计划之前检查测试计划的状态。下面是一个如何完成此操作的示例:private void runTestplan3(string testplan){if(TestExecSL1.LoadTestplan(testplan)){richTextBox1。
AppendText(testplan + Environment.NewLine);
string state = TestExecSL1.Testplan.State.ToString();
richTextBox1.AppendText(state + Environment.NewLine);
TestExecSL1.Testplan.Run();
state = TestExecSL1.Testplan.State.ToString();
richTextBox1.AppendText(state + Environment.NewLine);
int a;
a = string.Compare(state,“TestplanPassed”);
while(a!= 0){Thread.Sleep(1000);
// delay 1s state = TestExecSL1.Testplan.State.ToString();
a = string.Compare(state,“TestplanPassed”);
richTextBox1.AppendText(state + Environment.NewLine);
在加载另一个测试计划之前首先卸载testplan是一个好习惯//TestExecSL1.UnloadTestplan();
richTextBox1.AppendText(Environment.NewLine);
private void button3_Click(object sender,EventArgs e){richTextBox1.Clear();
string testplan =“C:\ My TxSL Files \ UUTs \ My UUT Name \ testplan1.tpa”;
runTestplan3(testplan);
testplan =“C:\ My TxSL Files \ UUTs \ My UUT Name \ testplan2.tpa”;
runTestplan3(testplan);
} _Question 2_:要选择单个测试项,可以使用object.Testplan.Tests.Item(index).Execute谢谢。
此致,辛西娅
以上来自于谷歌翻译
以下为原文
Hi Hemant,
_Question 1_:
You are able to run 1 testplan by 1 testplan. However, you should check the state of the testplan before loading the 2nd testplan using
object.Testplan.State
Here's an example how this can be done:
private void runTestplan3(string testplan)
{
if (TestExecSL1.LoadTestplan(testplan))
{
richTextBox1.AppendText(testplan + Environment.NewLine);
string state = TestExecSL1.Testplan.State.ToString();
richTextBox1.AppendText(state + Environment.NewLine);
TestExecSL1.Testplan.Run();
state = TestExecSL1.Testplan.State.ToString();
richTextBox1.AppendText(state + Environment.NewLine);
int a;
a = string.Compare(state, "TestplanPassed");
while (a != 0)
{
Thread.Sleep(1000); // delay 1s
state = TestExecSL1.Testplan.State.ToString();
a = string.Compare(state, "TestplanPassed");
richTextBox1.AppendText(state + Environment.NewLine);
}
// It is a good practice to unload testplan first before loading another testplan
//TestExecSL1.UnloadTestplan();
richTextBox1.AppendText(Environment.NewLine);
}
}
private void button3_Click(object sender, EventArgs e)
{
richTextBox1.Clear();
string testplan = "C:\My TxSL Files\UUTs\My UUT Name\testplan1.tpa";
runTestplan3 (testplan);
testplan = "C:\My TxSL Files\UUTs\My UUT Name\testplan2.tpa";
runTestplan3 (testplan);
}
_Question 2_:
To Select single test item, you may use
object.Testplan.Tests.Item(index).Execute
Thanks.
Regards,
Cynthia
Hi Hemant,_Question 1_:你可以通过1个testplan运行1个testplan。
但是,您应该在使用object.Testplan.State加载第二个测试计划之前检查测试计划的状态。下面是一个如何完成此操作的示例:private void runTestplan3(string testplan){if(TestExecSL1.LoadTestplan(testplan)){richTextBox1。
AppendText(testplan + Environment.NewLine);
string state = TestExecSL1.Testplan.State.ToString();
richTextBox1.AppendText(state + Environment.NewLine);
TestExecSL1.Testplan.Run();
state = TestExecSL1.Testplan.State.ToString();
richTextBox1.AppendText(state + Environment.NewLine);
int a;
a = string.Compare(state,“TestplanPassed”);
while(a!= 0){Thread.Sleep(1000);
// delay 1s state = TestExecSL1.Testplan.State.ToString();
a = string.Compare(state,“TestplanPassed”);
richTextBox1.AppendText(state + Environment.NewLine);
在加载另一个测试计划之前首先卸载testplan是一个好习惯//TestExecSL1.UnloadTestplan();
richTextBox1.AppendText(Environment.NewLine);
private void button3_Click(object sender,EventArgs e){richTextBox1.Clear();
string testplan =“C:\ My TxSL Files \ UUTs \ My UUT Name \ testplan1.tpa”;
runTestplan3(testplan);
testplan =“C:\ My TxSL Files \ UUTs \ My UUT Name \ testplan2.tpa”;
runTestplan3(testplan);
} _Question 2_:要选择单个测试项,可以使用object.Testplan.Tests.Item(index).Execute谢谢。
此致,辛西娅
以上来自于谷歌翻译
以下为原文
Hi Hemant,
_Question 1_:
You are able to run 1 testplan by 1 testplan. However, you should check the state of the testplan before loading the 2nd testplan using
object.Testplan.State
Here's an example how this can be done:
private void runTestplan3(string testplan)
{
if (TestExecSL1.LoadTestplan(testplan))
{
richTextBox1.AppendText(testplan + Environment.NewLine);
string state = TestExecSL1.Testplan.State.ToString();
richTextBox1.AppendText(state + Environment.NewLine);
TestExecSL1.Testplan.Run();
state = TestExecSL1.Testplan.State.ToString();
richTextBox1.AppendText(state + Environment.NewLine);
int a;
a = string.Compare(state, "TestplanPassed");
while (a != 0)
{
Thread.Sleep(1000); // delay 1s
state = TestExecSL1.Testplan.State.ToString();
a = string.Compare(state, "TestplanPassed");
richTextBox1.AppendText(state + Environment.NewLine);
}
// It is a good practice to unload testplan first before loading another testplan
//TestExecSL1.UnloadTestplan();
richTextBox1.AppendText(Environment.NewLine);
}
}
private void button3_Click(object sender, EventArgs e)
{
richTextBox1.Clear();
string testplan = "C:\My TxSL Files\UUTs\My UUT Name\testplan1.tpa";
runTestplan3 (testplan);
testplan = "C:\My TxSL Files\UUTs\My UUT Name\testplan2.tpa";
runTestplan3 (testplan);
}
_Question 2_:
To Select single test item, you may use
object.Testplan.Tests.Item(index).Execute
Thanks.
Regards,
Cynthia
举报