Example #1
0
 public ClickAction(AutomationAction automationActionData)
     : base(automationActionData)
 {
     this.Click = GetAttributeValue<bool>("click");
     this.ClickNew = GetAttributeValue<bool>("clicknew");
     this.MouseClick = GetAttributeValue<bool>("mouseclick");
 }
Example #2
0
 public ScrollAction(AutomationAction automationActionData)
     : base(automationActionData)
 {
     this.Position = GetAttributeValue<Position>("position");
     this.Offset = GetAttributeValue<int>("offset");
     this.Period = GetAttributeValue<int>("period", 500);
     this.Factor = GetAttributeValue<int>("factor", 0);
 }
Example #3
0
        public TextAction(AutomationAction automationActionData)
            : base(automationActionData)
        {
            this.Attrbute = this.GetAttributeValue<string>("text_attr");
            this.AttrbuteRegex = this.GetAttributeValue<string>("text_attr_regex");

            this.TextSaveKey = this.GetAttributeValue<string>("textSaveDatakey");
            this.TextGetKey = this.GetAttributeValue<string>("textGetDatakey");
        }
Example #4
0
        public void Add(AutomationAction action)
        {
            if (this.ActionList == null)
            {
                this.ActionList = new List<AutomationAction>();
            }

            this.ActionList.Add(action);
        }
        public void Test_LoadBrowserAction()
        {
            AutomationAction actionConfig = new AutomationAction();
            actionConfig.Type = "Mouse";
            IAction action = ClassLoader.LoadAction(actionConfig);

            Assert.IsNotNull(action);
            Assert.AreEqual(action.ActionType, ActionType.MouseAction);
        }
Example #6
0
 public MouseAction(AutomationAction automationActionData)
     : base(automationActionData)
 {
     this.Click = GetAttributeValue<bool>("click");
     this.ClickNew = GetAttributeValue<bool>("clicknew");
     this.MouseClick = GetAttributeValue<bool>("mouseclick");
     this.Over = GetAttributeValue<bool>("over");
     this.OverNew = GetAttributeValue<bool>("overnew");
     this.Down = GetAttributeValue<bool>("down");
     this.Up = GetAttributeValue<bool>("up");
     this.Focus = GetAttributeValue<bool>("focus");
     this.Move = GetAttributeValue<bool>("move");
     this.MoveNew = GetAttributeValue<bool>("movenew");
     this.MoveEnter = GetAttributeValue<bool>("moveenter");
 }
        public void Test_LoadConfig()
        {
            AutomationAction action = new AutomationAction();
            action.Type = "Mouse";

            AutomationAction childAction = new AutomationAction();
            childAction.Type = "Mouse";
            action.AddChild(childAction);

            AutomationStep step = new AutomationStep();
            step.Name = "First";
            step.Description = "test";
            step.Add(action);

            WebAutomationConfig config = new WebAutomationConfig();
            config.Add(step);

            AutomationManagement manager = new AutomationManagement();
            manager.LoadConfig(config);
        }
Example #8
0
        public FindAction(AutomationAction automationActionData)
            : base(automationActionData)
        {
            this.Combine = GetAttributeValue<bool>("combine");
            this.Contains = GetAttributeValue<bool>("contains");
            this.WildCard = GetAttributeValue<bool>("wildcard");
            this.Trim = GetAttributeValue<bool>("trim");

            this.ID = GetAttributeValue<string>("id");
            this.Name = GetAttributeValue<string>("name");
            this.ClassName = GetAttributeValue<string>("class");
            this.TagName = GetAttributeValue<string>("tagname");
            this.Type = GetAttributeValue<string>("type");
            this.Title = GetAttributeValue<string>("title");
            this.Url = GetAttributeValue<string>("href");
            this.InnerText = GetAttributeValue<string>("innertext");

            this.Index = GetAttributeValue<int>("index", -1);

            this.XPath = GetAttributeValue<string>("xpath");

            List<string> embedAttrbuteList = GetAttributeValueStartWith<string>("embed_");
            if (embedAttrbuteList != null && embedAttrbuteList.Count > 0)
            {
                this.EmbedAttribute = new Dictionary<string, string>();
                foreach (string str in embedAttrbuteList)
                {
                    int index = str.IndexOf(":");
                    if (index != -1)
                    {
                        string key = str.Substring(0, index);
                        string value = str.Substring(index + 1, str.Length - index - 1);

                        this.EmbedAttribute.Add(key, value);
                    }
                }
            }
        }
        public void Test_ConfigurationSerialize()
        {
            WebAutomationConfig config = new WebAutomationConfig();
            config.Name = "Test1";
            config.Version = "0.1";

            AutomationStep step = new AutomationStep();
            step.Name = "aaa";
            step.ActionList = new System.Collections.Generic.List<AutomationAction>();

            config.Add(step);

            AutomationAction action = new AutomationAction();
            action.Type = "Wait";

            AutomationActionAttribute attr = new AutomationActionAttribute();
            attr.Name = "name";
            attr.Value = "value";
            action.Add(attr);

            AutomationAction childAction = new AutomationAction();
            childAction.Type = "Click";
            childAction.Add(attr);

            action.AddChild(childAction);
            step.Add(action);

            WebAutomationConfig.Save(config);

            WebAutomationConfig loadConfig = WebAutomationConfig.Load();

            Assert.IsNotNull(loadConfig);
            Assert.AreEqual(loadConfig.Name, config.Name);
            Assert.AreEqual(loadConfig.StepList.Count, config.StepList.Count);
            Assert.AreEqual(loadConfig.StepList[0].Name, config.StepList[0].Name);
        }
Example #10
0
 public ClearDataAction(AutomationAction automationActionData)
     : base(automationActionData)
 {
 }
Example #11
0
 public SendKeyAction(AutomationAction automationActionData)
     : base(automationActionData)
 {
     this.Keys = GetAttributeValueStartWith<string>("sendkey_");
 }
        private void LoadConditionAction(IAction action, AutomationAction actionData)
        {
            if (actionData.ConditionActionList != null && actionData.ConditionActionList.Count > 0)
            {
                foreach (AutomationAction childData in actionData.ConditionActionList)
                {
                    if (!childData.Enabled)
                    {
                        continue;
                    }

                    IAction childAction = ConvertToAction(childData);
                    if (action.ConditoinAction == null)
                    {
                        action.ConditoinAction = new List<IAction>();
                    }
                    action.ConditoinAction.Add(childAction);

                    LoadConditionAction(childAction, childData);
                }
            }
        }
 private IAction ConvertToAction(AutomationAction actionData)
 {
     return ClassLoader.LoadAction(actionData);
 }
Example #14
0
 public BrowserAction(AutomationAction automationActionData)
     : base(automationActionData)
 {
     this.Name = GetAttributeValue<string>("name");
     this.Url = GetAttributeValue<string>("url");
 }
Example #15
0
 public ConditionAction(AutomationAction automationActionData)
     : base(automationActionData)
 {
 }
Example #16
0
 public static void Debug(AutomationAction AutomationActionData)
 {
     System.Diagnostics.Debug.WriteLine(AutomationActionData.ToString());
 }
Example #17
0
        public void AddChild(AutomationAction childAction)
        {
            if (this.ChildActionList == null)
            {
                this.ChildActionList = new List<AutomationAction>();
            }

            this.ChildActionList.Add(childAction);
        }
Example #18
0
 public WaitAction(AutomationAction automationActionData)
     : base(automationActionData)
 {
     this.Seconds = GetAttributeValue<int>("seconds");
     this.Milliseconds = GetAttributeValue<int>("milliseconds");
 }
 public ClearHistoryAction(AutomationAction automationActionData)
     : base(automationActionData)
 {
     this.ClearHistoryType = GetAttributeValue<ClearHistoryType>("type");
 }
Example #20
0
 public PageAction(AutomationAction automationActionData)
     : base(automationActionData)
 {
     this.MaxPageIndex = this.GetAttributeValue<int>("max", 10);
 }
Example #21
0
 public KeyboardAction(AutomationAction automationActionData)
     : base(automationActionData)
 {
     this.KeyDown = GetAttributeValue<bool>("keydown");
     this.KeyUp = GetAttributeValue<bool>("keyup");
 }
Example #22
0
 public TimerAction(AutomationAction automationActionData)
     : base(automationActionData)
 {
     this.Seconds = GetAttributeValue<int>("seconds");
 }
Example #23
0
 public ScriptAction(AutomationAction automationActionData)
     : base(automationActionData)
 {
     this.ScriptContent = GetAttributeValue<string>("script");
 }
Example #24
0
 public PackageAction(AutomationAction automationActionData)
     : base(automationActionData)
 {
 }