public override void RunCommand(object sender)
        {
            var engine = (AutomationEngineInstance)sender;

            var browserObject   = v_InstanceName.GetAppInstance(engine);
            var browserInstance = (InternetExplorer)browserObject;

            browserInstance.Navigate(v_URL.ConvertUserVariableToString(engine));
            IECreateBrowserCommand.WaitForReadyState(browserInstance);
        }
        private void RunCommandActions(IHTMLElement element, object sender, InternetExplorer browserInstance)
        {
            var engine = (AutomationEngineInstance)sender;

            switch (v_WebAction)
            {
            case "Fire onmousedown event":
                ((IHTMLElement3)element).FireEvent("onmousedown");
                break;

            case "Fire onmouseover event":
                ((IHTMLElement3)element).FireEvent("onmouseover");
                break;

            case "Invoke Click":
                element.click();
                IECreateBrowserCommand.WaitForReadyState(browserInstance);
                break;

            case "Left Click":
            case "Middle Click":
            case "Right Click":
                int elementXposition = FindElementXPosition(element);
                int elementYposition = FindElementYPosition(element);

                //inputs need to be validated

                int userXAdjust = Convert.ToInt32((from rw in v_WebActionParameterTable.AsEnumerable()
                                                   where rw.Field <string>("Parameter Name") == "X Adjustment"
                                                   select rw.Field <string>("Parameter Value")).FirstOrDefault().ConvertUserVariableToString(engine));

                int userYAdjust = Convert.ToInt32((from rw in v_WebActionParameterTable.AsEnumerable()
                                                   where rw.Field <string>("Parameter Name") == "Y Adjustment"
                                                   select rw.Field <string>("Parameter Value")).FirstOrDefault().ConvertUserVariableToString(engine));

                var ieClientLocation = User32Functions.GetWindowPosition(new IntPtr(browserInstance.HWND));

                SendMouseMoveCommand newMouseMove = new SendMouseMoveCommand();

                newMouseMove.v_XMousePosition = ((elementXposition + ieClientLocation.left + 10) + userXAdjust).ToString();                                  // + 10 gives extra padding
                newMouseMove.v_YMousePosition = ((elementYposition + ieClientLocation.top + 90 + SystemInformation.CaptionHeight) + userYAdjust).ToString(); // +90 accounts for title bar height
                newMouseMove.v_MouseClick     = v_WebAction;
                newMouseMove.RunCommand(sender);
                break;

            case "Set Attribute":
                string setAttributeName = (from rw in v_WebActionParameterTable.AsEnumerable()
                                           where rw.Field <string>("Parameter Name") == "Attribute Name"
                                           select rw.Field <string>("Parameter Value")).FirstOrDefault();

                string valueToSet = (from rw in v_WebActionParameterTable.AsEnumerable()
                                     where rw.Field <string>("Parameter Name") == "Value To Set"
                                     select rw.Field <string>("Parameter Value")).FirstOrDefault();

                valueToSet = valueToSet.ConvertUserVariableToString(engine);

                element.setAttribute(setAttributeName, valueToSet);
                break;

            case "Set Text":
                string setTextAttributeName = "value";

                string textToSet = (from rw in v_WebActionParameterTable.AsEnumerable()
                                    where rw.Field <string>("Parameter Name") == "Text To Set"
                                    select rw.Field <string>("Parameter Value")).FirstOrDefault();

                textToSet = textToSet.ConvertUserVariableToString(engine);

                element.setAttribute(setTextAttributeName, textToSet);
                break;

            case "Get Attribute":
                string attributeName = (from rw in v_WebActionParameterTable.AsEnumerable()
                                        where rw.Field <string>("Parameter Name") == "Attribute Name"
                                        select rw.Field <string>("Parameter Value")).FirstOrDefault();

                string variableName = (from rw in v_WebActionParameterTable.AsEnumerable()
                                       where rw.Field <string>("Parameter Name") == "Variable Name"
                                       select rw.Field <string>("Parameter Value")).FirstOrDefault();

                string convertedAttribute = Convert.ToString(element.getAttribute(attributeName));

                convertedAttribute.StoreInUserVariable(engine, variableName);
                break;
            }
        }