Kategória:TestMethods: Rozdiel medzi revíziami

Z SPIN2-wiki
Prejsť na: navigácia, hľadanie
(Vytvorená stránka „==Implementácia== Nech je vytvorený test s názvom TestUI Do projektu je potrebné pridať referencie: *Ranorex.Core.dll *TestUI.exe V príslušnom module je potrebné ...“)
 
(Implementácia)
Riadok 11: Riadok 11:
 
         public void TestUIRanorex()
 
         public void TestUIRanorex()
 
         {
 
         {
 +
            // Reagovanie na ukoncenie testu
 
             Ranorex.Keyboard.AbortKey = System.Windows.Forms.Keys.Pause;
 
             Ranorex.Keyboard.AbortKey = System.Windows.Forms.Keys.Pause;
  
 +
            // Spustenie celeho testu
 
             Ranorex.Core.Testing.TestSuiteRunner.Run(
 
             Ranorex.Core.Testing.TestSuiteRunner.Run(
 
                 typeof(TestUI.ClickerRepository), @"/testsuite:cesta k suboru TestUI.rxtst");
 
                 typeof(TestUI.ClickerRepository), @"/testsuite:cesta k suboru TestUI.rxtst");

Verzia zo dňa a času 14:42, 22. február 2013

Implementácia

Nech je vytvorený test s názvom TestUI

Do projektu je potrebné pridať referencie:

  • Ranorex.Core.dll
  • TestUI.exe

V príslušnom module je potrebné vytvoriť novú metódu typu TestMethod

        [TestMethod]
        public void TestUIRanorex()
        {
            // Reagovanie na ukoncenie testu
            Ranorex.Keyboard.AbortKey = System.Windows.Forms.Keys.Pause;

            // Spustenie celeho testu
            Ranorex.Core.Testing.TestSuiteRunner.Run(
                typeof(TestUI.ClickerRepository), @"/testsuite:cesta k suboru TestUI.rxtst");
        }}

Pre spustenie celého Test suite je vhodné použiť:

TestSuiteRunner.Run

Pre spustenie dielčích nahrávok sa použije:

Ranorex.Core.Testing.TestModuleRunner.Run(TestUI.StartSUT.Instance);
Ranorex.Core.Testing.TestModuleRunner.Run(TestUI.LogIn.Instance);
Ranorex.Core.Testing.TestModuleRunner.Run(TestUI.CloseSUT.Instance);

Táto kategória momentálne neobsahuje články ani multimediálne súbory.