2013-10-16 38 views
1

我使用Test Automation FX创建了自动化测试,我是初学者。测试自动化FX中的错误报告FX

我需要知道如何从测试脚本中失败测试?

我正在使用C#脚本。

说,如果我想认识一些窗口控制,并必须在执行操作:

if(window["Exists"]) 
{ 
    //Perform action. 
} 
else 
{ 
    // move to the next test cases. 
} 

我不知道如何处理的其他部分?

回答

0

报告测试案例失败时,窗口不存在,你可以使用Verify类的下列方法从Test Automation FX API

FailTest方法:

if (window["Exist"]) 
    { 
     // Perform actions 
    } 
    else 
    { 
     Verify.FailTest("Window does not exist"); // Report failure message that will be shown in test report 
    } 

AreEqual方法:

Verify.AreEqual(window["Exist"], true); // will fail test if window dows not exist 
    // Perform actions 
+0

Thanq安德里...它工作得很好:) – Srinidhi