public void GenerateTest1()
        {
            List <IElement>          allElements = new RanorexRxrepAnalyzer().Analyze(@"C:\Users\duongtd\Desktop\samples\Ranorex\Sample1\NewRepository-V20170822.rxrep");
            MyLog                    myLog       = new MyLog();
            ExcelSpecificationParser excelSpecificationParser = new ExcelSpecificationParser();
            List <SpecScreen>        specScreens = excelSpecificationParser.ParseWithRootElements(
                @"C:\Users\duongtd\Desktop\samples\Ranorex\Sample1\TSDV-Sample-UserCode-Spec.xlsx",
                //@"D:\Research\projects\GUI-Testing-Automation\ProjectGenTemplate\Copy of TSDV-Sample-Mapping-Spec.xlsx",
                allElements, myLog);

            UserActionSpecAnalyzer specAnalyzer = new UserActionSpecAnalyzer();

            specAnalyzer.Expand(specScreens, @"C:\MyApp.exe", myLog);

            CSharpScriptsGeneration scriptsGeneration = new RanorexScriptsGeneration();

            scriptsGeneration.Generate(
                specScreens,
                @"D:\temp\out\project1",
                @"D:\temp\ElementsRepo.xml",
                @"D:\temp\ImageCapture.xml",
                @"D:\temp\app.exe",
                "MyTestProjectDefinition",
                "MyTestProject",
                "Instance",
                myLog);
        }
        public void GenerateRanorexProjectTest()
        {
            string                   repoFilePath             = @"C:\Users\duongtd\Desktop\samples\Ranorex\Sample1\NewRepository.rxrep";
            List <IElement>          allElements              = new RanorexRxrepAnalyzer().Analyze(repoFilePath);
            MyLog                    myLog                    = new MyLog();
            ExcelSpecificationParser excelSpecificationParser = new ExcelSpecificationParser();
            List <SpecScreen>        specScreens              = excelSpecificationParser.ParseWithRootElements(
                //@"C:\Users\duongtd\Desktop\samples\Ranorex\Sample1\TSDV-Sample-UserCode-Spec.xlsx",
                @"C:\Users\duongtd\Desktop\samples\Ranorex\Sample1\TSDV-Sample-Test.xlsx",
                //@"D:\Research\projects\GUI-Testing-Automation\ProjectGenTemplate\Copy of TSDV-Sample-Mapping-Spec.xlsx",
                allElements, myLog);

            UserActionSpecAnalyzer specAnalyzer = new UserActionSpecAnalyzer();

            specAnalyzer.Expand(specScreens, @"C:\MyApp.exe", myLog);

            ProjectGeneration projectGeneration = new ProjectGeneration();

            projectGeneration.GenerateRanorexProject(allElements,
                                                     specScreens,
                                                     repoFilePath,
                                                     @"C:\Users\duongtd\Desktop\samples\Ranorex\exported",
                                                     @"C:\MyApp.exe",
                                                     myLog);
            System.Diagnostics.Debug.WriteLine(String.Join(",\n", myLog.GetErrorLogs().ToArray()));
        }
Exemplo n.º 3
0
        public void GenRawRanorexScriptsTest()
        {
            ClickSpecUserAction clickSpecUserAction = new ClickSpecUserAction();

            clickSpecUserAction.Expression = @"Click[1;2]";// 'File' -> 'Open' -> 'Cloud'";

            List <IElement> allElements = new RanorexRxrepAnalyzer().Analyze(@"C:\Users\duongtd\Desktop\samples\Ranorex\Sample1\NewRepository-V20170822.rxrep");
            MyLog           myLog       = new MyLog();

            RanorexScriptGenerationParams param = new RanorexScriptGenerationParams();

            param.ListUIElements = new ListUIElements(ListElementsIndicator.OnlyRootElements, allElements);
            param.InstanceName   = "repo";
            param.Id             = 1;
            param.MyLog          = myLog;
            param.ScreenName     = "Testing";
            param.SpecNode       = new SpecNode("MainForm")
            {
                UIElement = allElements[0],
            };
            var re = clickSpecUserAction.GenRanorexScripts(param);
        }