Ranorex入门指南35 – 测试用例启动过程

想要了解一个自动化测试工具,需要知道它是如何启动,并且运行测试用例的,今天我们先简单的展示一下,一个Ranorex的测试用例是如何启动并且执行的。

首先,让我们稍微改造一下上一个例子的代码,只需要在Run函数里面加入一句Delay使之成为如下,从而使得我们有时间查看真个启动过程:
void ITestModule.Run()
{
Mouse.DefaultMoveTime = 300;
Keyboard.DefaultKeyPressTime = 100;
Delay.SpeedFactor = 1.0;

// add delay
Delay.Seconds(120);

}

紧接着我们启动执行测试用例,可以看到Ranorex Studio最下方的output窗口会首先进行project的build,显示如下的信息:
Build started.
[Message : MSBuild] Skipping target “CoreCompile” because all output files are up-to-date with respect to the input files.
[Message : MSBuild] Skipping target “_CopyOutOfDateSourceItemsToOutputDirectory” because all output files are up-to-date with respect to the input files.
[Message : Copy] Copying file from “C:\Documents and Settings\Administrator\My Documents\Ranorex\RanorexStudio Projects\SimpleGUITest\SimpleGUITest\SimpleGUITest.rxtmg” to “bin\Debug\SimpleGUITest.rxtmg”.
[Message : Copy] Copying file from “C:\Documents and Settings\Administrator\My Documents\Ranorex\RanorexStudio Projects\SimpleGUITest\SimpleGUITest\SimpleGUITest.rxtst” to “bin\Debug\SimpleGUITest.rxtst”.
[Message : MSBuild] Skipping target “_CopyAppConfigFile” because all output files are up-to-date with respect to the input files.
Build finished successfully. (00:00:00.2500000)

再然后,Debug窗口也会显示不少内容,如下所示,主要是Load一些dll做好执行用例的准备工作:
Module Loaded: mscorlib.dll
Module Loaded: SimpleGUITest.exe
Module Loaded: Ranorex.Core.dll
Module Loaded: System.dll
Module Loaded: System.Windows.Forms.dll
Module Loaded: System.Drawing.dll
Module Loaded: Ranorex.Core.WinApi.dll
Module Loaded: msvcm90.dll
Module Loaded: Ranorex.Libs.dll
Module Loaded: Ranorex.Plugin.Win32.dll
Module Loaded: Ranorex.Libs.WinForms.dll
Module Loaded: System.Xml.dll
Module Loaded: Ranorex.Plugin.Msaa.dll
Module Loaded: Ranorex.Plugin.web.dll
Module Loaded: Ranorex.Plugin.Wpf.dll
Module Loaded: UIAutomationTypes.dll
Module Loaded: UIAutomationClient.dll
Module Loaded: Ranorex.Plugin.WinForms.dll
Module Loaded: Ranorex.Plugin.MozillaWeb.dll
Module Loaded: Ranorex.Plugin.ChromeWeb.dll
Module Loaded: Ranorex.Plugin.Flex.dll
Module Loaded: Ranorex.Plugin.Office.dll
Module Loaded: Ranorex.Plugin.RawText.dll
Module Loaded: Ranorex.Plugin.Java.dll
Module Loaded: Ranorex.Plugin.Mobile.dll
Module Loaded: System.Configuration.dll

紧接着出现的cmd命令行窗口会,打印一系列的Ranorex测试用例执行信息:
2012/10/04 09:11:36.436][Debug ][Logger]: Console logger starting.
2012/10/04 09:11:36.561][Info ][Test]: Test Suite ‘SimpleGUITest’ started.
2012/10/04 09:11:36.577][Info ][Test]: Test Case ‘WriteTestCase’ started.
2012/10/04 09:11:36.577][Info ][Test]: Test Module ‘SimpleCode’ started.

可以看到,首先是启动Debug模式下的log功能,接着运行Test Suite,再调用其中的Test Case,接着是其下的Test Module.

Leave a comment

请输入正确的验证码