Ejemplo n.º 1
0
        public void Execute(IDictionary<string, object> variables, Dictionary<string, ObjectInfo> library, string[] parameters)
        {
            Console.WriteLine("SelectTreeNode.Execute");

            var browser = (IWebDriver)variables["BrowserInstance"];
            if (browser != null)
            {
                // Accept paramenter with node texts concatenated with "^^",
                // Example: "SOCIAL STUDIES^^1st Grade^^Social Studies - Grade 1"
                var nodesParam = parameters[1].Split(new[] { "^^" }, StringSplitOptions.None);

                if (String.IsNullOrEmpty(parameters[1]) || !nodesParam.Any())
                {
                    throw new TestingException("SelectTreeNode: Parameter is empty or not in correct format");
                }

                var nodes = GetNodes(nodesParam);

                var clickElement = new ClickElement();
                var selectType = parameters[0];
                foreach (var node in nodes)
                {
                    clickElement.Execute(variables, library, new[] { selectType, node, string.Empty });
                }
            }
            else
            {
                throw new TestingException("Browser Instance not found!");
            }
        }
Ejemplo n.º 2
0
 private void InitFields()
 {
     _openBrowser = new OpenBrowser();
     _navigateTo = new NavigateTo();
     _sendKey = new SendKeys();
     _clickElement = new ClickElement();
     _gotoFrame = new SwitchTo();
     _sendKeysExtJsTextArea = new SendKeysInEditor();
     _selectExtJsCombo = new SelectExtJSCombo();
     _selectExtTreeNode = new SelectTreeNode();
     _delay = new Delay();
     _variables = new Dictionary<string, object>
     {
         {"Browser", "Firefox"},
         {"Environment Type", "web"},
         {"TestCaseStepDelay", 250}
     };
 }