完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
电子发烧友论坛|
嗨,我正在使用vb .net创建一个Windows窗体应用程序。
表单应用程序有3个按钮来执行测试用例。 在testexecsl中,我创建了2个testplan(.tpa文件),每个文件只有一个测试。 第三个测试计划有2个测试(测试计划1和2的测试)。 TestPlan1.tpa(Test1)TestPlan2.tpa(Test2)TestPlan3.tpa(Test1& Test2)现在使用testexecsl activeX控件我正在加载& 在表单应用程序按钮上单击运行上面的testplan。 'On Button1_click Task1()'On Button2_click Task2()'On Button3_click Task1()'Thread.sleep(2000)Task2()'下面是vb函数Public Sub Task1()txsl1.LoadTestplan(“C: TestPlans Testplan1” .tpa“)txsl1.Testplan.Run()End Sub Public Sub Task2()txsl1.LoadTestplan(”C: TestPlans Testplan2.tpa“)txsl1.Testplan.Run()End Sub Public Sub Task3()txsl1.LoadTestplan (“C: TestPlans Testplan3.tpa”)txsl1.Testplan.Run()End Sub上面的代码适用于按钮1和2,但对于按钮3,我得到异常。 下面是描述RPC服务器不可用。[来自HRESULT的异常:0x800706BA)。 我尝试从service.msi启用RPC定位器服务,但没有成功。 1.是否允许,加载并运行多个测试计划? 2.我无法使用所有测试创建单个测试计划(.tpa),因为我必须执行一个测试或两个测试。我不知道如何在测试计划(.tpa)中选择单个测试。 我检查了testexecsl API。 pl提供解决方案。 最诚挚的问候,Hemant。 以上来自于谷歌翻译 以下为原文 Hi, I am creating a windows form application using vb .net. form app has 3 buttons to execute testcases. In testexecsl i have created 2 testplan (.tpa files), each with one test only. And the third testplan with 2 tests (tests of testplan 1&2). TestPlan1.tpa ( Test1) TestPlan2.tpa ( Test2) TestPlan3.tpa ( Test1 & Test2) Now using testexecsl activeX control i am loading & running the above testplan's on form application button click. 'On Button1_click Task1() 'On Button2_click Task2() 'On Button3_click Task1() 'Thread.sleep(2000) Task2() 'Below are the vb functions Public Sub Task1() txsl1.LoadTestplan("C:TestPlansTestplan1.tpa") txsl1.Testplan.Run() End Sub Public Sub Task2() txsl1.LoadTestplan("C:TestPlansTestplan2.tpa") txsl1.Testplan.Run() End Sub Public Sub Task3() txsl1.LoadTestplan("C:TestPlansTestplan3.tpa") txsl1.Testplan.Run() End Sub The above code works fine for button 1 and 2 , but for button 3 i am getting exception. below is the description The RPC server is unavailable .[exception from HRESULT: 0x800706BA). I tried by enabling the RPC locator services from the service.msi , but no success. 1. Is it allowed ,Loading and running multiple testplan? 2. I cannot create a single testplan(.tpa) with all the tests since i have to perform either one test or both .and i don't know how to select a single tests within a testplan(.tpa). i checked the testexecsl API's . pl provide solution. Best Regards, Hemant. |
|
相关推荐
1个回答
|
|
|
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 |
|
|
|
|
只有小组成员才能发言,加入小组>>
1844 浏览 0 评论
2739 浏览 1 评论
2640 浏览 1 评论
2449 浏览 5 评论
3458 浏览 3 评论
1845浏览 0评论
417浏览 0评论
/9
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2025-12-2 06:33 , Processed in 0.593333 second(s), Total 42, Slave 35 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191

淘帖
2755