public TestSpecificationScreen parse(TestSpecificationSheet testSpecSheet,
                                             ListUIElements elementsAndIndicator, MyLog myLog, List <ClassExpression> classExpressions)
        {
            NormalSheetParser normalSheetParser = new NormalSheetParser();
            SpecScreen        screen            = normalSheetParser.Parse(testSpecSheet, elementsAndIndicator, myLog);

            if (screen == null)
            {
                return(null);
            }
            TestSpecificationScreen re = new TestSpecificationScreen();

            re.AllUIElements          = elementsAndIndicator;
            re.ListSpecNodes          = screen.ListSpecNodes;
            re.ListValidationUserCode = screen.ListValidationUserCode;
            re.MappingAliasWithNode   = screen.MappingAliasWithNode;
            re.Name             = testSpecSheet.getFeatureName();
            re.Scenarios        = screen.Scenarios;
            re.ClassExpressions = classExpressions;
            return(re);
        }
        /// <summary>
        /// 'GetAttributeValue<object>("Text")' for Ranorex
        /// </summary>
        /// <param name="nodeExp"></param>
        /// <param name="listUIElements"></param>
        /// <param name="mappingAlias"></param>
        /// <param name="myLog"></param>
        /// <param name="instanceName"></param>
        /// <returns></returns>
        public static string Node2ParamExp(string nodeExp, ListUIElements listUIElements, Dictionary <string, string> mappingAlias, MyLog myLog, string instanceName, ScriptType scriptType)
        {
            Tuple <IElement, string> elementAndAttibute = NormalSheetParser.parseNodeAndAttribute(nodeExp, listUIElements, mappingAlias, myLog);

            if (elementAndAttibute == null || elementAndAttibute.Item1 == null)
            {
                myLog.Warn("cannot find node: " + nodeExp);
                return("null");
            }
            if (scriptType == ScriptType.Normal)
            {
                return(GetScriptAccessElement(elementAndAttibute.Item1, instanceName));
            }
            //Ranorex scripts
            string re = getScriptAccessRanorexElement(
                new SpecNode(elementAndAttibute.Item1, elementAndAttibute.Item2, null), instanceName);

            if (elementAndAttibute.Item2 != null && !elementAndAttibute.Item2.Equals(""))
            {
                re += ".GetAttributeValue<object>(\"" + elementAndAttibute.Item2 + "\")";
            }
            return(re);
        }
Example #3
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="normalSheet"></param>
        /// <param name="elementsAndIndicator">indication to determine root elements or list of all elements</param>
        /// <param name="myLog"></param>
        /// <returns></returns>
        private SpecScreen parseNormalSheet(NormalSheet normalSheet, ListUIElements elementsAndIndicator, MyLog myLog)
        {
            NormalSheetParser normalSheetParser = new NormalSheetParser();

            return(normalSheetParser.Parse(normalSheet, elementsAndIndicator, myLog));
        }