コード例 #1
0
 internal ActionSatisfiesPredicateQuery(BrowserAction tryThis, PredicateQuery until, Options options, TimingStrategy timingStrategy)
 {
     this.tryThis        = tryThis;
     this.until          = until;
     this.timingStrategy = timingStrategy;
     Options             = options;
 }
コード例 #2
0
        private void NavigateToSearch()
        {
            Stopwatch timer   = new Stopwatch();
            int       timeout = 30;

            timer.Start();

            GeckoHtmlElement search = null;

            while (timer.Elapsed.TotalSeconds < timeout && search == null)
            {
                var elements = Browser.Document.GetElementsByClassName("searchpeople");
                if (elements.Count() > 0)
                {
                    search = (GeckoHtmlElement)elements[0];
                }

                if (search != null)
                {
                    search.Click();
                    this.CurrentAction = EnableAdvancedSearch;
                    break;
                }

                Application.DoEvents();
            }
        }
コード例 #3
0
 public TryUntilArgs(BrowserAction tryThis, Query <bool> until, TimeSpan overallTimeout, TimeSpan waitBeforeRetry)
 {
     OverallTimeout       = overallTimeout;
     WaitBeforeRetry      = waitBeforeRetry;
     TryThisBrowserAction = tryThis;
     Until = until;
 }
コード例 #4
0
        private void UpdateElement()
        {
            string text = "";

            for (int i = 0; i < comboBox1.Items.Count; i++)
            {
                if (comboBox1.SelectedIndex == i)
                {
                    text = comboBox1.Items[i].ToString();
                }
            }
            if (text == "")
            {
                return;
            }
            foreach (var baseObject in availableBaseObjects)
            {
                if (((BaseObject)baseObject).GetType().Name == text)
                {
                    if (baseObject is BrowserCommand)
                    {
                        TemplateElement = new TemplateElement(textBoxName.Text, baseObject);
                    }
                    else
                    {
                        BrowserAction browserAction = new BrowserAction();
                        browserAction.ActionObject = baseObject;
                        TemplateElement            = new TemplateElement(textBoxName.Text, browserAction);
                    }
                    textBoxDescription.Text = ((BaseObject)baseObject).Description;
                }
            }
        }
コード例 #5
0
        private void ResponseObserver_AuthResponseReceived(object sender, ResponseEventArgs e)
        {
            AuthResponse authResponse = JsonConvert.DeserializeObject <AuthResponse>(e.Data);

            if (authResponse != null)
            {
                if (authResponse.error == null)
                {
                    Log.Information("Authendication Success! Navigating to Search...");
                    this.CurrentAction = QueueNavigateToSearch;
                }
                else
                {
                    try
                    {
                        MessageBox.Show("Login Failed! " + authResponse.error.apiErrors[0].message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }
                    catch (Exception ex)
                    {
                        MessageBox.Show("Login Failed! Unknown Error.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }
                    Log.Warning("Authendication Failed!");
                }
            }
        }
コード例 #6
0
        protected override void OnProcess(IAction action)
        {
            BrowserAction pageAction = action as BrowserAction;

            webBrowser.Navigate(pageAction.Url);

            LoggerManager.Debug(action.AutomationActionData);
        }
コード例 #7
0
 internal ActionSatisfiesPredicateQuery(BrowserAction tryThis, PredicateQuery until, TimeSpan overallTimeout, TimeSpan retryInterval, TimeSpan waitBeforeRetry, RobustWrapper robustWrapper)
 {
     this.tryThis         = tryThis;
     this.until           = until;
     this.waitBeforeRetry = waitBeforeRetry;
     this.robustWrapper   = robustWrapper;
     RetryInterval        = retryInterval;
     Timeout = overallTimeout;
 }
コード例 #8
0
        public void TryUntil(BrowserAction tryThis, PredicateQuery until, Options options)
        {
            var outcome = Synchronise(new ActionSatisfiesPredicateQuery(tryThis, until, options, this));

            if (!outcome)
            {
                throw new MissingHtmlException("Timeout from TryUntil: the page never reached the required state.");
            }
        }
コード例 #9
0
        public void TryUntil(BrowserAction tryThis, PredicateQuery until, TimeSpan overrallTimeout, TimeSpan waitBeforeRetry)
        {
            var outcome = Robustly(new ActionSatisfiesPredicateQuery(tryThis, until, overrallTimeout, until.RetryInterval, waitBeforeRetry, this));

            if (!outcome)
            {
                throw new MissingHtmlException("Timeout from TryUntil: the page never reached the required state.");
            }
        }
コード例 #10
0
        static public XmlDocument retrieve(RequestType reqType, StringDictionary parameters)
        {
            logger.Debug("Starting Request for type: " + reqType.ToString());

            BrowserAction action = getBrowserAction(reqType, parameters);

            XmlDocument doc = action.doAction();

            return(doc);
        }
コード例 #11
0
 /// <summary>
 /// Browser 事件驱动框架
 /// 构造函数
 /// 实体使用方法
 /// </summary>
 /// <param name="browserTestStep">browser步骤所有信息</param>
 public BrowserEDA(TestStep browserTestStep)
 {
     _browserAction      = browserTestStep.WebAction.Action as BrowserAction;
     ComArgs.SigTestStep = browserTestStep;
     //提取超时
     if (_browserAction != null)
     {
         TimeSpan timeSpan = TimeSpan.FromSeconds(_browserAction.Timeout);
         _webDriverWait = new WebDriverWait(ComArgs.WebTestDriver, timeSpan);
     }
 }
コード例 #12
0
 public BrowserRule(int priority, BrowserOS osName, double osMinVersion, double osMaxVersion, string architecture, string name, double minVersion, double maxVersion, BrowserAction action)
 {
     Priority     = priority;
     OSName       = osName;
     OSMinVersion = osMinVersion;
     OSMaxVersion = osMaxVersion;
     Architecture = architecture;
     Name         = name;
     MinVersion   = minVersion;
     MaxVersion   = maxVersion;
     Action       = action;
 }
コード例 #13
0
 private void Browser_DocumentCompleted(object sender, Gecko.Events.GeckoDocumentCompletedEventArgs e)
 {
     if (CurrentAction != null)
     {
         BrowserAction tmpAction = CurrentAction;
         CurrentAction = null;
         tmpAction.Invoke();
     }
     else
     {
         Console.WriteLine("");
     }
 }
コード例 #14
0
        public static CefDecodeResult Decode(string plainText)
        {
            SerializeContainer container =
                (SerializeContainer)
                Deserializer.DeserializeObjectFromString(
                    plainText, typeof(SerializeContainer));
            string serializedChild = EncodingEx.Base64.Decoder.DecodeString(System.Text.Encoding.UTF8,
                                                                            container.SerializedEncodedChild);
            Type   t   = Type.GetType(container.ChildType);
            object obj =
                Deserializer.DeserializeObjectFromString(
                    serializedChild, t);

            if (obj is BrowserAction)
            {
                BrowserAction action = (BrowserAction)obj;
                action.ActionObject = Deserializer.DeserializeObjectFromString(EncodingEx.Base64.Decoder.DecodeString(Encoding.UTF8, action.SerializedActionObject),
                                                                               Type.GetType(action.SerializedActionObjectType));
                action.SerializedActionObject = "";
            }

            return(new CefDecodeResult(obj, t, container.UCID));
        }
コード例 #15
0
        public static string Encode(string ucid, object obj)
        {
            try
            {
                if (obj is BrowserAction)
                {
                    BrowserAction action = (BrowserAction)obj;
                    action.SerializedActionObjectType = action.ActionObject.GetType().AssemblyQualifiedName;
                    string serializedObject = Serializer.SerializeObjectToString(action.ActionObject,
                                                                                 action.ActionObject.GetType());
                    action.SerializedActionObject = EncodingEx.Base64.Encoder.EncodeString(Encoding.UTF8, serializedObject
                                                                                           );
                    action.ActionObject = null;
                }

                string serialized =
                    Serializer.SerializeObjectToString(obj,
                                                       obj.GetType());
                SerializeContainer container = new SerializeContainer();
                container.UCID = ucid;
                container.SerializedEncodedChild = EncodingEx.Base64.Encoder.EncodeString(System.Text.Encoding.UTF8,
                                                                                          serialized);
                container.ChildType = obj.GetType().AssemblyQualifiedName;
                string serializedCommand =
                    Serializer.SerializeObjectToString(container,
                                                       container.GetType());
                string msg = EncodingEx.Base64.Encoder.EncodeString(System.Text.Encoding.UTF8, serializedCommand
                                                                    );
                return(msg);
            }
            catch (Exception ex)
            {
                ExceptionHandling.Handling.GetException("Unexpected", ex);
                return(null);
            }
        }
コード例 #16
0
 public void TryUntil(BrowserAction tryThis, PredicateQuery until, Options options = null)
 {
     timingStrategy.TryUntil(tryThis, until, Merge(options));
 }
コード例 #17
0
        private void buttonCreateDemoTemplate_Click(object sender, EventArgs e)
        {
            List <TemplateElement> templateElements = new List <TemplateElement>();


            SwitchWindowVisibility visibility = new SwitchWindowVisibility();

            visibility.NewInstance();
            visibility.Visible.Value = true;
            templateElements.Add(new TemplateElement("show window", visibility));

            //Dont forget to change identifier to real one!
            LoadUrl url = new LoadUrl();

            url.NewInstance();
            url.Url.Value = "http://keepass.info/help/kb/testform.html";
            templateElements.Add(new TemplateElement("Load Site", url));

            BrowserAction actionLoaded = new BrowserAction();
            SiteLoaded    siteLoaded   = new SiteLoaded();

            siteLoaded.NewInstance();
            siteLoaded.ExpectedSiteToLoad.Value         = url.Url;
            siteLoaded.ExpectedSiteToLoad.IsRegex.Value = false;
            actionLoaded.ActionObject = siteLoaded;
            templateElements.Add(new TemplateElement("Check if Site has loaded", actionLoaded));

            BrowserAction checkNumberOfElements1 = new CefBrowserControl.BrowserAction();
            ElementToLoad loadElement            = new ElementToLoad();

            loadElement.NewInstance();
            loadElement.Selector.SelectorExecuteActionOn  = BrowserAction.ExecuteActionOn.Id;
            loadElement.Selector.SelectorString           = "LoginFormUser";
            loadElement.Selector.ExpectedNumberOfElements = new InsecureInt(1);
            checkNumberOfElements1.ActionObject           = loadElement;
            templateElements.Add(new TemplateElement("Check if Form exists", checkNumberOfElements1));


            BrowserAction imageAction = new BrowserAction();
            GetImage      getImage1   = new GetImage();

            getImage1.NewInstance();
            imageAction.ActionObject                   = getImage1;
            getImage1.Selector.SelectorString          = "/html/body/table/tbody/tr[1]/td/table/tbody/tr/td[1]/img";
            getImage1.Selector.SelectorExecuteActionOn = BrowserAction.ExecuteActionOn.Xpath;
            TemplateElement getImageTemplateElement = new TemplateElement("Download KeePass Image", imageAction);

            templateElements.Add(getImageTemplateElement);


            GetInputFromUser input = new GetInputFromUser();

            input.NewInstance();
            input.InputNeeded.Value = true;
            input.InsecureDisplayObjects.Add(new InsecureText("Please type in 'OK'. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."));
            input.InsecureDisplayObjects.Add(new InsecureImage(Template.EncodeTemplateElementIdWithOutputName(getImageTemplateElement.UEID, GetImage.KeyList.Base64String.ToString())));
            TemplateElement templateElement1 = new TemplateElement("Get OK from User", input);

            templateElement1.SuccessConditions.Add(new Condition("Contains", Template.EncodeTemplateElementIdWithOutputName("", GetInputFromUser.KeyList.UserInputResult.ToString()), "OK"));
            templateElements.Add(templateElement1);


            //----------------------------


            BrowserAction checkNumberOfElements2 = new CefBrowserControl.BrowserAction();
            ElementToLoad elementToLoad2         = new ElementToLoad();

            elementToLoad2.NewInstance();
            checkNumberOfElements2.ActionObject                    = elementToLoad2;
            elementToLoad2.Selector.SelectorExecuteActionOn        = BrowserAction.ExecuteActionOn.Name;
            elementToLoad2.Selector.SelectorString                 = "pwd";
            elementToLoad2.Selector.ExpectedNumberOfElements.Value = 1;
            templateElements.Add(new TemplateElement("Check if Form Field 'pwd' exists", checkNumberOfElements2));

            BrowserAction checkNumberOfElements3 = new CefBrowserControl.BrowserAction();
            ElementToLoad elementToLoad3         = new ElementToLoad();

            elementToLoad3.NewInstance();
            checkNumberOfElements3.ActionObject                    = elementToLoad3;
            elementToLoad3.Selector.SelectorExecuteActionOn        = BrowserAction.ExecuteActionOn.Name;
            elementToLoad3.Selector.SelectorString                 = "LoginForm";
            elementToLoad3.Selector.ExpectedNumberOfElements.Value = 1;
            templateElements.Add(new TemplateElement("Check if Form Field 'LoginForm' exists", checkNumberOfElements3));

            BrowserAction enteryUserName       = new BrowserAction();
            SetAttribute  setAttributeUserName = new SetAttribute();

            setAttributeUserName.NewInstance();
            enteryUserName.ActionObject = setAttributeUserName;
            setAttributeUserName.AttributeName.Value = "Value";
            setAttributeUserName.ValueToSet.Value    = BaseObject.ConvertStringToPlaceholderString(PwDefs.UserNameField);
            setAttributeUserName.Selector.ExpectedNumberOfElements.Value = 1;
            setAttributeUserName.Selector.SelectorExecuteActionOn        = BrowserAction.ExecuteActionOn.Id;
            setAttributeUserName.Selector.SelectorString = "LoginFormUser";
            templateElements.Add(new TemplateElement("enter username", enteryUserName));

            BrowserAction enterPassword        = new BrowserAction();
            SetAttribute  setAttributePassword = new SetAttribute();

            setAttributePassword.NewInstance();
            enterPassword.ActionObject = setAttributePassword;
            setAttributePassword.AttributeName.Value = "Value";
            setAttributePassword.ValueToSet.Value    = BaseObject.ConvertStringToPlaceholderString(PwDefs.PasswordField) + " " + BaseObject.ConvertStringToPlaceholderString("");
            setAttributePassword.Selector.ExpectedNumberOfElements.Value = 1;
            setAttributePassword.Selector.SelectorExecuteActionOn        = BrowserAction.ExecuteActionOn.Name;
            setAttributePassword.Selector.SelectorString = "pwd";
            templateElements.Add(new TemplateElement("enter password", enterPassword));

            BrowserAction handleJsDialog = new BrowserAction();
            SetJsPrompt   setJsPrompt    = new SetJsPrompt();

            setJsPrompt.NewInstance();
            handleJsDialog.ActionObject                   = setJsPrompt;
            setJsPrompt.ExpectedDialogType.Value          = GetJsPrompt.DialogTypes.Alert;
            setJsPrompt.ExpectedMessageText.IsRegex.Value = true;
            setJsPrompt.ExpectedMessageText.Value.Value   = "The following data would have been submitted";
            templateElements.Add(new TemplateElement("set jsdialog handler", handleJsDialog));

            SwitchWindowVisibility visibility2 = new SwitchWindowVisibility();

            visibility2.NewInstance();
            visibility2.Visible.Value = false;
            templateElements.Add(new TemplateElement("hide window", visibility2));

            BrowserAction clickSubmit  = new BrowserAction();
            InvokeSubmit  invokeSubmit = new InvokeSubmit();

            invokeSubmit.NewInstance();
            clickSubmit.ActionObject = invokeSubmit;
            invokeSubmit.Selector.SelectorExecuteActionOn        = BrowserAction.ExecuteActionOn.Name;
            invokeSubmit.Selector.SelectorString                 = "LoginForm";
            invokeSubmit.Selector.ExpectedNumberOfElements.Value = 1;
            templateElements.Add(new TemplateElement("submit form", clickSubmit));

            BrowserAction checkJsDialog = new BrowserAction();
            GetJsPrompt   getJsPrompt   = new GetJsPrompt();

            getJsPrompt.NewInstance();
            checkJsDialog.ActionObject                    = getJsPrompt;
            getJsPrompt.ExpectedDialogType.Value          = GetJsPrompt.DialogTypes.Alert;
            getJsPrompt.ExpectedMessageText.IsRegex.Value = true;
            getJsPrompt.ExpectedMessageText.Value.Value   = "The following data would have been submitted";
            TemplateElement templateElement2 = new TemplateElement("get jsdialog", checkJsDialog);

            templateElement2.SuccessConditions.Add(new Condition("Contains",
                                                                 Template.EncodeTemplateElementIdWithOutputName("", GetJsPrompt.KeyList.MessageText.ToString()),
                                                                 "The following data would have been submitted"));
            templateElements.Add(templateElement2);

            Template template = new Template(1,
                                             new StringOrRegex()
            {
                IsRegex = new InsecureBool(true), Value = new InsecureText("keepass")
            },
                                             "KeePass TestForm, some illegal chars: \"M\"\\a/ry/ h**ad:>> a\\/:*?\"| li*tt|le|| la\"mb.?", new PasswordCreationPolicy(), templateElements);

            AddTemplate(template);
            RefreshUI();
        }
コード例 #18
0
 public void TryUntil(BrowserAction tryThis, PredicateQuery until, Options options)
 {
     tryThis.Act();
 }
コード例 #19
0
        private void ProcessingTimer_Elapsed(object sender, ElapsedEventArgs e)
        {
            processingTimer.Stop();
            try
            {
                MessagesLock.AcquireWriterLock(Options.LockTimeOut);
                try
                {
                    if (ReceivedMessagesList.Count > 0)
                    {
                        try
                        {
                            BrowserListsLock.AcquireWriterLock(Options.LockTimeOut);
                            try
                            {
                                foreach (string message in ReceivedMessagesList)
                                {
                                    //DEBUG
                                    //Console.WriteLine(message);
                                    string plain = EncodingEx.Base64.Decoder.DecodeString(Encoding.UTF8, message);
                                    try
                                    {
                                        CefDecodeResult cefDecodeResult = CefDecoding.Decode(plain);
                                        if (cefDecodeResult.DecodedObject is BrowserAction)
                                        {
                                            BrowserAction browserAction = (BrowserAction)cefDecodeResult.DecodedObject;
                                            BaseObject    baseObject    = ((BaseObject)browserAction.ActionObject);
                                            baseObject.ExecuteEventHandler = true;
                                            baseObject.SetFinished(true);

                                            BrowserActionsInTransit.Remove(cefDecodeResult.UCID);
                                            BrowserActionsCompleted.Add(cefDecodeResult.UCID, cefDecodeResult.DecodedObject);
                                        }
                                        else if (cefDecodeResult.DecodedObject is BrowserCommand)
                                        {
                                            BrowserCommand browerCommand = (BrowserCommand)cefDecodeResult.DecodedObject;
                                            browerCommand.ExecuteEventHandler = true;
                                            browerCommand.SetCompleted(true);

                                            BrowserCommandsInTransit.Remove(cefDecodeResult.UCID);
                                            BrowserCommandsCompleted.Add(cefDecodeResult.UCID, cefDecodeResult.DecodedObject);
                                        }
                                    }
                                    catch (Exception ex)
                                    {
                                        ExceptionHandling.Handling.GetException("Unexpected", ex);
                                    }
                                }
                                ReceivedMessagesList.Clear();
                            }
                            catch (Exception ex)
                            {
                                ExceptionHandling.Handling.GetException("Unexpected", ex);
                            }
                        }
                        catch (ApplicationException ex1)
                        {
                            ExceptionHandling.Handling.GetException("ReaderWriterLock", ex1);
                        }
                        finally
                        {
                            if (BrowserListsLock.IsWriterLockHeld)
                            {
                                BrowserListsLock.ReleaseWriterLock();
                            }
                        }
                    }
                }
                catch (Exception ex)
                {
                    ExceptionHandling.Handling.GetException("Unexpected", ex);
                }
            }
            catch (ApplicationException ex1)
            {
                ExceptionHandling.Handling.GetException("ReaderWriterLock", ex1);
            }
            finally
            {
                if (MessagesLock.IsWriterLockHeld)
                {
                    MessagesLock.ReleaseWriterLock();
                }
            }
            try
            {
                BrowserListsLock.AcquireWriterLock(Options.LockTimeOut);
                if (BrowserActions.Count > 0 || BrowserCommands.Count > 0)
                {
                    try
                    {
                        MessagesLock.AcquireWriterLock(Options.LockTimeOut);
                        foreach (var browserCommandKeyValuePair in BrowserCommands)
                        {
                            try
                            {
                                string commandType = browserCommandKeyValuePair.Value.GetType().ToString();
                                //Console.WriteLine(commandType);
                                switch (commandType)
                                {
                                //Pass to application, or ucid will be very wrong...
                                case "CefBrowserControl.BrowserCommands.Open":
                                    Open open = (Open)browserCommandKeyValuePair.Value;
                                    if (!CefBrowserSessions.ContainsKey(open.UID))
                                    {
                                        ////Todo: Clean Shutdown
                                        Process p = Process.Start("CefBrowser.exe", open.UID + (CefBrowserControl.Options.IsDebug?" --debug":""));
                                        CefBrowserSessions.Add(open.UID, p);
                                        //TODO: Add code that checks thread
                                    }
                                    _rpcReaderWriter.AddClient(open.UID);
                                    //BrowserCommandsCompleted.Add(open.UCID, open);
                                    goto default;

                                case "CefBrowserControl.BrowserCommands.Quit":
                                    Quit quit = (Quit)browserCommandKeyValuePair.Value;
                                    if (quit.All)
                                    {
                                        foreach (var cefBrowserSession in CefBrowserSessions)
                                        {
                                            Process process = cefBrowserSession.Value;
                                            if (process != null)
                                            {
                                                process.Kill();
                                            }
                                            _rpcReaderWriter.RemoveClient(quit.UID);
                                        }
                                        quit.Successful = true;
                                        CefBrowserSessions.Clear();
                                    }
                                    else
                                    {
                                        Process process = CefBrowserSessions[quit.UID];
                                        if (process != null)
                                        {
                                            process.Kill();
                                        }
                                        quit.Successful = true;
                                        CefBrowserSessions.Remove(quit.UID);
                                        _rpcReaderWriter.RemoveClient(quit.UID);
                                    }
                                    quit.Completed = true;
                                    BrowserCommandsCompleted.Add(quit.UCID, quit);
                                    break;

                                default:
                                    BrowserCommand cmd = (BrowserCommand)browserCommandKeyValuePair.Value;
                                    PendingMessagesList.Add(new KeyValuePairEx <string, string>(cmd.UID, CefEncoding.Encode(cmd.UCID, cmd)));
                                    BrowserCommandsInTransit.Add(cmd.UCID, cmd);
                                    break;
                                }
                            }
                            catch (Exception ex)
                            {
                                ExceptionHandling.Handling.GetException("Unexpected", ex);
                            }
                        }
                        foreach (var browserActionKeyValuePair in BrowserActions)
                        {
                            try
                            {
                                BrowserAction browserAction = (BrowserAction)browserActionKeyValuePair.Value;
                                PendingMessagesList.Add(new KeyValuePairEx <string, string>(browserAction.UID, CefEncoding.Encode(browserAction.UCID, browserActionKeyValuePair.Value)));
                                BrowserCommandsInTransit.Add(browserAction.UCID, browserAction);
                                //PendingMessagesList.Add("CefBAAS-1", CefEncoding.EncodeString(browserActionKeyValuePair.Key, browserActionKeyValuePair.ExpectedValue));
                                //BrowserActionsInTransit.Add(browserActionKeyValuePair.Key, browserActionKeyValuePair.ExpectedValue);
                            }
                            catch (Exception ex)
                            {
                                ExceptionHandling.Handling.GetException("Unexpected", ex);
                            }
                        }
                        BrowserCommands.Clear();
                        BrowserActions.Clear();
                    }
                    catch (ApplicationException ex2)
                    {
                        ExceptionHandling.Handling.GetException("ReaderWriterLock", ex2);
                    }
                    finally
                    {
                        if (MessagesLock.IsWriterLockHeld)
                        {
                            MessagesLock.ReleaseWriterLock();
                        }
                    }
                }
            }
            catch (ApplicationException ex1)
            {
                ExceptionHandling.Handling.GetException("ReaderWriterLock", ex1);
            }
            finally
            {
                if (BrowserListsLock.IsWriterLockHeld)
                {
                    BrowserListsLock.ReleaseWriterLock();
                }
            }
            processingTimer.Start();
        }
コード例 #20
0
ファイル: DriverScope.cs プロジェクト: bszypelow/coypu
 public void TryUntil(BrowserAction tryThis, PredicateQuery until, TimeSpan waitBeforeRetry, Options options = null)
 {
     robustWrapper.TryUntil(tryThis, until, SetOptions(options).Timeout, waitBeforeRetry);
 }
コード例 #21
0
ファイル: DriverScope.cs プロジェクト: bszypelow/coypu
 public void RetryUntilTimeout(BrowserAction action)
 {
     Query(action);
 }
コード例 #22
0
 public void TryUntil(BrowserAction tryThis, PredicateQuery until, Options options)
 {
     DeferredTryUntils.Add(new TryUntilArgs(tryThis, until, options));
 }
コード例 #23
0
 public TryUntilArgs(BrowserAction tryThis, Query <bool> until, Options options)
 {
     TryThisBrowserAction = tryThis;
     Until   = until;
     Options = options;
 }
コード例 #24
0
        //Returns true on success or false on timeout/fail...
        public bool RunTemplate(TemplateElement element, CefControl cefControl)
        {
            LastTemplateElement = element.Name + " @ TemplateElement-ID " + element.UEID;
            BaseObject baseObject = null;

            if (element.BrowserActionOrCommand is BrowserCommand)
            {
                baseObject = ((BaseObject)element.BrowserActionOrCommand);
                if (baseObject.TimeoutInSec != null)
                {
                    baseObject.Timeout = new TimeSpan(0, 0, baseObject.TimeoutInSec.Value);
                }
            }
            else if (element.BrowserActionOrCommand is BrowserAction)
            {
                baseObject = ((BaseObject)((BrowserAction)element.BrowserActionOrCommand).ActionObject);
                if (baseObject.TimeoutInSec != null)
                {
                    baseObject.Timeout = new TimeSpan(0, 0, baseObject.TimeoutInSec.Value);
                }
            }
            //rework anyhow?
            //@ requirement calculation: is required a pwdef placeholder?
            foreach (var requiredParameterString in element.RequiredParameters)
            {
                foreach (var availableResource in AvailableResources)
                {
                    if (requiredParameterString == availableResource.Key && availableResource.Value is Text)
                    {
                        KeyValuePairEx <string, string> data =
                            new KeyValuePairEx <string, string>(requiredParameterString,
                                                                ((Text)availableResource.Value).Value.ReadString());
                        baseObject.OverloadData.Add(data);
                    }
                }
            }

            if (element.BrowserActionOrCommand is BrowserCommand)
            {
                BrowserCommand command = (BrowserCommand)element.BrowserActionOrCommand;
                command.UID = UID;
                command.GenerateNewUcid(UTID);

                _cefControl.AddCefBrowserCommand(element.BrowserActionOrCommand);

                while (true)
                {
                    Thread.Sleep(100);
                    if (CefControl.BrowserCommandsCompleted.ContainsKey(command.UCID))
                    {
                        BrowserCommand browserCommandCompleted = (BrowserCommand)CefControl.BrowserCommandsCompleted[command.UCID];

                        foreach (var outputPlacholderToValuePair in browserCommandCompleted.ReturnedOutput)
                        {
                            string identifier = EncodeTemplateElementIdWithOutputName(element.UEID,
                                                                                      outputPlacholderToValuePair.Key);
                            int?forRemoving = null;
                            for (var i = 0; i < AvailableResources.Count; i++)
                            {
                                if (AvailableResources[i].Key ==
                                    identifier /* && AvailableResources[i].ExpectedValue == null*/)
                                {
                                    forRemoving = i;
                                }
                            }
                            if (forRemoving != null)
                            {
                                AvailableResources.RemoveAt((int)forRemoving);
                            }
                            AvailableResources.Add(
                                new KeyValuePairEx <string, object>(
                                    identifier, new Text(new ProtectedString(true, outputPlacholderToValuePair.Value != null ? outputPlacholderToValuePair.Value : ""))));
                            //else
                            //{
                            //    //Console.WriteLine("w000T");
                            //}
                        }
                        foreach (var conditionsToTemplateElement in element.ConditionBasedAppendedTemplateElements)
                        {
                            bool success = true;
                            foreach (var condition in conditionsToTemplateElement.Key)
                            {
                                string firstOperand    = condition.FirstOperand,
                                         secondOperand = condition.SecondOperand;
                                if (firstOperand == BaseObject.ConvertStringToPlaceholderString("successfull"))
                                {
                                    firstOperand = browserCommandCompleted.Successful.ToString();
                                }
                                else if (firstOperand == BaseObject.ConvertStringToPlaceholderString("completed"))
                                {
                                    firstOperand = browserCommandCompleted.Completed.ToString();
                                }
                                else if (firstOperand.Contains(BaseObject.ConvertStringToPlaceholderString("output")))
                                {
                                    firstOperand = GetValueFromEncodedTemplateOperand(firstOperand, conditionsToTemplateElement.Value);
                                }
                                else if (element.RequiredParameters.Contains(firstOperand))
                                {
                                    foreach (var availableResource in AvailableResources)
                                    {
                                        if (availableResource.Key == firstOperand)
                                        {
                                            firstOperand = availableResource.Value.ToString();
                                            break;
                                        }
                                    }
                                }
                                if (secondOperand == BaseObject.ConvertStringToPlaceholderString("successfull"))
                                {
                                    secondOperand = browserCommandCompleted.Successful.ToString();
                                }
                                else if (secondOperand == BaseObject.ConvertStringToPlaceholderString("completed"))
                                {
                                    secondOperand = browserCommandCompleted.Completed.ToString();
                                }
                                else if (secondOperand.Contains(BaseObject.ConvertStringToPlaceholderString("output")))
                                {
                                    secondOperand = GetValueFromEncodedTemplateOperand(firstOperand, conditionsToTemplateElement.Value);
                                }
                                else if (element.RequiredParameters.Contains(secondOperand))
                                {
                                    foreach (var availableResource in AvailableResources)
                                    {
                                        if (availableResource.Key == secondOperand)
                                        {
                                            secondOperand = availableResource.Value.ToString();
                                            break;
                                        }
                                    }
                                }
                                if (!condition.Compare(firstOperand, secondOperand))
                                {
                                    success = false;
                                    break;
                                }
                            }
                            if (success)
                            {
                                if (!RunTemplate(conditionsToTemplateElement.Value, _cefControl))
                                {
                                    return(false);
                                }
                            }
                        }
                        foreach (var elementSuccessCondition in element.SuccessConditions)
                        {
                            string firstOperand    = elementSuccessCondition.FirstOperand,
                                     secondOperand = elementSuccessCondition.SecondOperand;
                            if (firstOperand == BaseObject.ConvertStringToPlaceholderString("successfull"))
                            {
                                firstOperand = browserCommandCompleted.Successful.ToString();
                            }
                            else if (firstOperand == BaseObject.ConvertStringToPlaceholderString("completed"))
                            {
                                firstOperand = browserCommandCompleted.Completed.ToString();
                            }
                            else if (firstOperand.Contains(BaseObject.ConvertStringToPlaceholderString("output")))
                            {
                                firstOperand = GetValueFromEncodedTemplateOperand(firstOperand, element);
                            }
                            else if (element.RequiredParameters.Contains(firstOperand))
                            {
                                foreach (var availableResource in AvailableResources)
                                {
                                    if (availableResource.Key == firstOperand)
                                    {
                                        firstOperand = availableResource.Value.ToString();
                                        break;
                                    }
                                }
                            }
                            if (secondOperand == BaseObject.ConvertStringToPlaceholderString("successfull"))
                            {
                                secondOperand = browserCommandCompleted.Successful.ToString();
                            }
                            else if (secondOperand == BaseObject.ConvertStringToPlaceholderString("completed"))
                            {
                                secondOperand = browserCommandCompleted.Completed.ToString();
                            }
                            else if (secondOperand.Contains(BaseObject.ConvertStringToPlaceholderString("output")))
                            {
                                secondOperand = GetValueFromEncodedTemplateOperand(firstOperand, element);
                            }
                            else if (element.RequiredParameters.Contains(secondOperand))
                            {
                                foreach (var availableResource in AvailableResources)
                                {
                                    if (availableResource.Key == secondOperand)
                                    {
                                        secondOperand = availableResource.Value.ToString();
                                        break;
                                    }
                                }
                            }
                            if (!elementSuccessCondition.Compare(firstOperand, secondOperand))
                            {
                                LastTemplateElementFailureReason = "Failed @ following success condition: " +
                                                                   elementSuccessCondition.ConditionToString(
                                    firstOperand, secondOperand);
                                return(false);
                            }
                        }
                        if (element.AppendedTemplateElement != null)
                        {
                            if (!RunTemplate(element.AppendedTemplateElement, _cefControl))
                            {
                                return(false);
                            }
                        }
                        break;
                    }
                    if (CefBrowserControl.Timeout.ShouldBreakDueTimeout(baseObject))
                    {
                        LastTemplateElementFailureReason = "Command Timeout";
                        return(false);
                    }
                }
                if (!((BrowserCommand)CefControl.BrowserCommandsCompleted[command.UCID]).Successful)
                {
                    LastTemplateElementFailureReason = "Failed Browser Command in CefBrowser";
                    return(false);
                }
            }
            else if (element.BrowserActionOrCommand is BrowserAction)
            {
                BrowserAction action = (BrowserAction)element.BrowserActionOrCommand;
                action.UID = UID;
                action.GenerateNewUCID(UTID);
                ((BaseObject)action.ActionObject).OverloadData = baseObject.OverloadData;
                cefControl.AddCefBrowserAction(element.BrowserActionOrCommand);

                while (true)
                {
                    Thread.Sleep(100);
                    if (CefControl.BrowserActionsCompleted.ContainsKey(action.UCID))
                    {
                        BrowserAction browserActionCompleted = (BrowserAction)CefControl.BrowserActionsCompleted[action.UCID];
                        BaseObject    subObject = (BaseObject)browserActionCompleted.ActionObject;

                        foreach (var outputPlacholderToValuePair in subObject.ReturnedOutput)
                        {
                            string identifier = EncodeTemplateElementIdWithOutputName(element.UEID,
                                                                                      outputPlacholderToValuePair.Key);
                            int?forRemoving = null;
                            for (var i = 0; i < AvailableResources.Count; i++)
                            {
                                if (AvailableResources[i].Key ==
                                    identifier /* && AvailableResources[i].ExpectedValue == null*/)
                                {
                                    forRemoving = i;
                                }
                            }
                            if (forRemoving != null)
                            {
                                AvailableResources.RemoveAt((int)forRemoving);
                            }
                            AvailableResources.Add(
                                new KeyValuePairEx <string, object>(
                                    identifier, new Text(new ProtectedString(true, outputPlacholderToValuePair.Value != null ? outputPlacholderToValuePair.Value : ""))));
                            //else
                            //{
                            //    //Console.WriteLine("w000T");
                            //}
                        }

                        foreach (var templateElement in TemplateElements)
                        {
                            if (templateElement.UEID == element.UEID)
                            {
                                templateElement.BrowserActionOrCommand = CefControl.BrowserActionsCompleted[action.UCID];
                            }
                        }
                        foreach (var conditionsToTemplateElement in element.ConditionBasedAppendedTemplateElements)
                        {
                            bool success = true;
                            foreach (var condition in conditionsToTemplateElement.Key)
                            {
                                string firstOperand    = condition.FirstOperand,
                                         secondOperand = condition.SecondOperand;
                                if (firstOperand == BaseObject.ConvertStringToPlaceholderString("successfull"))
                                {
                                    firstOperand = subObject.Successful.ToString();
                                }
                                else if (firstOperand == BaseObject.ConvertStringToPlaceholderString("completed"))
                                {
                                    firstOperand = subObject.Completed.ToString();
                                }
                                else if (firstOperand.Contains(BaseObject.ConvertStringToPlaceholderString("output")))
                                {
                                    firstOperand = GetValueFromEncodedTemplateOperand(firstOperand, conditionsToTemplateElement.Value);
                                }
                                else if (element.RequiredParameters.Contains(firstOperand))
                                {
                                    foreach (var availableResource in AvailableResources)
                                    {
                                        if (availableResource.Key == firstOperand)
                                        {
                                            firstOperand = availableResource.Value.ToString();
                                            break;
                                        }
                                    }
                                }
                                if (secondOperand == BaseObject.ConvertStringToPlaceholderString("successfull"))
                                {
                                    secondOperand = subObject.Successful.ToString();
                                }
                                else if (secondOperand == BaseObject.ConvertStringToPlaceholderString("completed"))
                                {
                                    secondOperand = subObject.Completed.ToString();
                                }
                                else if (secondOperand.Contains(BaseObject.ConvertStringToPlaceholderString("output")))
                                {
                                    secondOperand = GetValueFromEncodedTemplateOperand(firstOperand, conditionsToTemplateElement.Value);
                                }
                                else if (element.RequiredParameters.Contains(secondOperand))
                                {
                                    foreach (var availableResource in AvailableResources)
                                    {
                                        if (availableResource.Key == secondOperand)
                                        {
                                            secondOperand = availableResource.Value.ToString();
                                            break;
                                        }
                                    }
                                }
                                if (!condition.Compare(firstOperand, secondOperand))
                                {
                                    success = false;
                                    break;
                                }
                            }
                            if (success)
                            {
                                if (!RunTemplate(conditionsToTemplateElement.Value, _cefControl))
                                {
                                    return(false);
                                }
                            }
                        }
                        foreach (var elementSuccessCondition in element.SuccessConditions)
                        {
                            string firstOperand    = elementSuccessCondition.FirstOperand,
                                     secondOperand = elementSuccessCondition.SecondOperand;
                            if (firstOperand == BaseObject.ConvertStringToPlaceholderString("successfull"))
                            {
                                firstOperand = subObject.Successful.ToString();
                            }
                            else if (firstOperand == BaseObject.ConvertStringToPlaceholderString("completed"))
                            {
                                firstOperand = subObject.Completed.ToString();
                            }
                            else if (firstOperand.Contains(BaseObject.ConvertStringToPlaceholderString("output")))
                            {
                                firstOperand = GetValueFromEncodedTemplateOperand(firstOperand, element);
                            }
                            else if (element.RequiredParameters.Contains(firstOperand))
                            {
                                foreach (var availableResource in AvailableResources)
                                {
                                    if (availableResource.Key == firstOperand)
                                    {
                                        firstOperand = availableResource.Value.ToString();
                                        break;
                                    }
                                }
                            }
                            if (secondOperand == BaseObject.ConvertStringToPlaceholderString("successfull"))
                            {
                                secondOperand = subObject.Successful.ToString();
                            }
                            else if (secondOperand == BaseObject.ConvertStringToPlaceholderString("completed"))
                            {
                                secondOperand = subObject.Completed.ToString();
                            }
                            else if (secondOperand.Contains(BaseObject.ConvertStringToPlaceholderString("output")))
                            {
                                secondOperand = GetValueFromEncodedTemplateOperand(secondOperand, element);
                            }
                            else if (element.RequiredParameters.Contains(secondOperand))
                            {
                                foreach (var availableResource in AvailableResources)
                                {
                                    if (availableResource.Key == secondOperand)
                                    {
                                        secondOperand = availableResource.Value.ToString();
                                        break;
                                    }
                                }
                            }
                            if (!elementSuccessCondition.Compare(firstOperand, secondOperand))
                            {
                                LastTemplateElementFailureReason = "Failed @ following success condition: " +
                                                                   elementSuccessCondition.ConditionToString(
                                    firstOperand, secondOperand);
                                return(false);
                            }
                        }
                        if (element.AppendedTemplateElement != null)
                        {
                            if (!RunTemplate(element.AppendedTemplateElement, _cefControl))
                            {
                                return(false);
                            }
                        }
                        break;
                    }
                    if (CefBrowserControl.Timeout.ShouldBreakDueTimeout(baseObject))
                    {
                        LastTemplateElementFailureReason = "Action Timeout";
                        return(false);
                    }
                }
                if (!((BaseObject)((BrowserAction)CefControl.BrowserActionsCompleted[action.UCID]).ActionObject).Successful)
                {
                    string text = "";
                    foreach (var keyValuePair in ((BaseObject)action.ActionObject).ReturnedOutput)
                    {
                        text += "Entry: " + keyValuePair.Key + " --> " + keyValuePair.Value + ".";
                    }
                    LastTemplateElementFailureReason = "Failed Browser Action in CefBrowser: " + text;
                    return(false);
                }
            }
            return(true);
        }
コード例 #25
0
 public void TryUntil(BrowserAction tryThis, PredicateQuery until, TimeSpan overallTimeout, TimeSpan waitBeforeRetry)
 {
     DeferredTryUntils.Add(new TryUntilArgs(tryThis, until, overallTimeout, waitBeforeRetry));
 }
コード例 #26
0
 public void ReadAvailableInputParameters()
 {
     CheckRequiredParameters();
     if (BrowserActionOrCommand is BrowserCommand)
     {
         if (BrowserActionOrCommand is GetInputFromUser)
         {
             ((GetInputFromUser)BrowserActionOrCommand).ReadAvailableInputParameters();
         }
         else if (BrowserActionOrCommand is LoadUrl)
         {
             ((LoadUrl)BrowserActionOrCommand).ReadAvailableInputParameters();
         }
         else if (BrowserActionOrCommand is SwitchUserInputEnabling)
         {
             ((SwitchUserInputEnabling)BrowserActionOrCommand).ReadAvailableInputParameters();
         }
         else if (BrowserActionOrCommand is SwitchWindowVisibility)
         {
             ((SwitchWindowVisibility)BrowserActionOrCommand).ReadAvailableInputParameters();
         }
         else
         {
             ExceptionHandling.Handling.GetException("Unexpected",
                                                     new Exception("Browser Command should be found!"));
         }
     }
     else
     {
         BrowserAction browserAction = (BrowserAction)BrowserActionOrCommand;
         //TODO read browseraction specific inputs when later wanted
         if (browserAction.ActionObject is InvokeMouseClick && browserAction.ActionObject.GetType().Name == typeof(InvokeMouseClick).Name)
         {
             ((InvokeMouseClick)browserAction.ActionObject).ReadAvailableInputParameters();
         }
         else if (browserAction.ActionObject is ElementToClickOn && browserAction.ActionObject.GetType().Name == typeof(ElementToClickOn).Name)
         {
             ((ElementToClickOn)browserAction.ActionObject).ReadAvailableInputParameters();
         }
         else if (browserAction.ActionObject is ElementToLoad && browserAction.ActionObject.GetType().Name == typeof(ElementToLoad).Name)
         {
             ((ElementToLoad)browserAction.ActionObject).ReadAvailableInputParameters();
         }
         else if (browserAction.ActionObject is EventToTrigger && browserAction.ActionObject.GetType().Name == typeof(EventToTrigger).Name)
         {
             ((EventToTrigger)browserAction.ActionObject).ReadAvailableInputParameters();
         }
         else if (browserAction.ActionObject is FrameLoaded && browserAction.ActionObject.GetType().Name == typeof(FrameLoaded).Name)
         {
             ((FrameLoaded)browserAction.ActionObject).ReadAvailableInputParameters();
         }
         else if (browserAction.ActionObject is GetAttribute && browserAction.ActionObject.GetType().Name == typeof(GetAttribute).Name)
         {
             ((GetAttribute)browserAction.ActionObject).ReadAvailableInputParameters();
         }
         else if (browserAction.ActionObject is GetFrameNames && browserAction.ActionObject.GetType().Name == typeof(GetFrameNames).Name)
         {
             ((GetFrameNames)browserAction.ActionObject).ReadAvailableInputParameters();
         }
         else if (browserAction.ActionObject is GetHttpAuth && browserAction.ActionObject.GetType().Name == typeof(GetHttpAuth).Name)
         {
             ((GetHttpAuth)browserAction.ActionObject).ReadAvailableInputParameters();
         }
         else if (browserAction.ActionObject is GetImage && browserAction.ActionObject.GetType().Name == typeof(GetImage).Name)
         {
             ((GetImage)browserAction.ActionObject).ReadAvailableInputParameters();
         }
         else if (browserAction.ActionObject is GetJsPrompt && browserAction.ActionObject.GetType().Name == typeof(GetJsPrompt).Name)
         {
             ((GetJsPrompt)browserAction.ActionObject).ReadAvailableInputParameters();
         }
         else if (browserAction.ActionObject is GetStyle && browserAction.ActionObject.GetType().Name == typeof(GetStyle).Name)
         {
             ((GetStyle)browserAction.ActionObject).ReadAvailableInputParameters();
         }
         else if (browserAction.ActionObject is HasAttributeSetTo && browserAction.ActionObject.GetType().Name == typeof(HasAttributeSetTo).Name)
         {
             ((HasAttributeSetTo)browserAction.ActionObject).ReadAvailableInputParameters();
         }
         else if (browserAction.ActionObject is HasStyleSetTo && browserAction.ActionObject.GetType().Name == typeof(HasStyleSetTo).Name)
         {
             ((HasStyleSetTo)browserAction.ActionObject).ReadAvailableInputParameters();
         }
         else if (browserAction.ActionObject is InvokeSubmit && browserAction.ActionObject.GetType().Name == typeof(InvokeSubmit).Name)
         {
             ((InvokeSubmit)browserAction.ActionObject).ReadAvailableInputParameters();
         }
         else if (browserAction.ActionObject is JavascriptToExecute && browserAction.ActionObject.GetType().Name == typeof(JavascriptToExecute).Name)
         {
             ((JavascriptToExecute)browserAction.ActionObject).ReadAvailableInputParameters();
         }
         else if (browserAction.ActionObject is ResourceToLoad && browserAction.ActionObject.GetType().Name == typeof(ResourceToLoad).Name)
         {
             ((ResourceToLoad)browserAction.ActionObject).ReadAvailableInputParameters();
         }
         else if (browserAction.ActionObject is ReturnNode && browserAction.ActionObject.GetType().Name == typeof(ReturnNode).Name)
         {
             ((ReturnNode)browserAction.ActionObject).ReadAvailableInputParameters();
         }
         else if (browserAction.ActionObject is SecondsToWait && browserAction.ActionObject.GetType().Name == typeof(SecondsToWait).Name)
         {
             ((SecondsToWait)browserAction.ActionObject).ReadAvailableInputParameters();
         }
         else if (browserAction.ActionObject is SetAttribute && browserAction.ActionObject.GetType().Name == typeof(SetAttribute).Name)
         {
             ((SetAttribute)browserAction.ActionObject).ReadAvailableInputParameters();
         }
         else if (browserAction.ActionObject is SetHttpAuth && browserAction.ActionObject.GetType().Name == typeof(SetHttpAuth).Name)
         {
             ((SetHttpAuth)browserAction.ActionObject).ReadAvailableInputParameters();
         }
         else if (browserAction.ActionObject is SetJsPrompt && browserAction.ActionObject.GetType().Name == typeof(SetJsPrompt).Name)
         {
             ((SetJsPrompt)browserAction.ActionObject).ReadAvailableInputParameters();
         }
         else if (browserAction.ActionObject is SetStyle && browserAction.ActionObject.GetType().Name == typeof(SetStyle).Name)
         {
             ((SetStyle)browserAction.ActionObject).ReadAvailableInputParameters();
         }
         else if (browserAction.ActionObject is SiteLoaded && browserAction.ActionObject.GetType().Name == typeof(SiteLoaded).Name)
         {
             ((SiteLoaded)browserAction.ActionObject).ReadAvailableInputParameters();
         }
         else if (browserAction.ActionObject is TextToTypeIn && browserAction.ActionObject.GetType().Name == typeof(TextToTypeIn).Name)
         {
             ((TextToTypeIn)browserAction.ActionObject).ReadAvailableInputParameters();
         }
         else if (browserAction.ActionObject is GetInnerText && browserAction.ActionObject.GetType().Name == typeof(GetInnerText).Name)
         {
             ((GetInnerText)browserAction.ActionObject).ReadAvailableInputParameters();
         }
         else if (browserAction.ActionObject is GetInnerHtml && browserAction.ActionObject.GetType().Name == typeof(GetInnerHtml).Name)
         {
             ((GetInnerHtml)browserAction.ActionObject).ReadAvailableInputParameters();
         }
         else if (browserAction.ActionObject is SetValue && browserAction.ActionObject.GetType().Name == typeof(SetValue).Name)
         {
             ((SetValue)browserAction.ActionObject).ReadAvailableInputParameters();
         }
         else if (browserAction.ActionObject is SecondsToWait && browserAction.ActionObject.GetType().Name == typeof(SecondsToWait).Name)
         {
             ((SecondsToWait)browserAction.ActionObject).ReadAvailableInputParameters();
         }
         else if (browserAction.ActionObject is InvokeFullKeyboardEvent && browserAction.ActionObject.GetType().Name == typeof(InvokeFullKeyboardEvent).Name)
         {
             ((InvokeFullKeyboardEvent)browserAction.ActionObject).ReadAvailableInputParameters();
         }
         else
         {
             ExceptionHandling.Handling.GetException("Unexpected",
                                                     new Exception("Browser Action Object should be found!"));
         }
     }
     if (AppendedTemplateElement != null)
     {
         AppendedTemplateElement.ReadAvailableInputParameters();
     }
     foreach (var conditionsToTemplateElement in ConditionBasedAppendedTemplateElements)
     {
         if (conditionsToTemplateElement.Value != null)
         {
             conditionsToTemplateElement.Value.ReadAvailableInputParameters();
         }
     }
 }
コード例 #27
0
 public Manifest()
 {
     browser_action = new BrowserAction();
 }
コード例 #28
0
 private void QueueNavigateToSearch()
 {
     this.CurrentAction = NavigateToSearch;
 }
コード例 #29
0
 public void TryUntil(BrowserAction tryThis, PredicateQuery until, TimeSpan overallTimeout, TimeSpan waitBeforeRetry)
 {
     tryThis.Act();
 }
コード例 #30
0
 public BrowserActionMessage(BrowserAction action) {
     Action = action;
 }