示例#1
0
        public void LoginToWeb(string username, string password, Boolean immediateExecution = true)
        {
            ProtractorConnect.ImmediateExecution = immediateExecution;
            EnterTextActionParams enterTextActionParams;

            string response;

            enterTextActionParams = new EnterTextActionParams()
            {
                text = username
            };
            ProtractorConnect.command(new Action()
            {
                action = "EnterText", controlName = "User Name Textbox", actionParamsJSON = Newtonsoft.Json.JsonConvert.SerializeObject(enterTextActionParams)
            });

            response = ProtractorConnect.getResponse(immediateExecution);

            enterTextActionParams = new EnterTextActionParams()
            {
                text = password
            };
            ProtractorConnect.command(new Action()
            {
                action = "EnterText", controlName = "Password Textbox", actionParamsJSON = Newtonsoft.Json.JsonConvert.SerializeObject(enterTextActionParams)
            });

            response = ProtractorConnect.getResponse(immediateExecution);

            ProtractorConnect.command(new Action()
            {
                action = "Click", controlName = "Login Button"
            });

            response = ProtractorConnect.getResponse(immediateExecution);

            if (immediateExecution == false)
            {
                ProtractorConnect.sendCommands();
                response = ProtractorConnect.getResponse();
            }
        }
示例#2
0
        public string obtainActivePageHeading(Boolean immediateExecution = true)
        {
            string headerText = "";

            ProtractorConnect.ImmediateExecution = immediateExecution;

            ProtractorConnect.command(new Action()
            {
                action = "Read", controlName = "Active Breadcrumb"
            });

            headerText = ProtractorConnect.getResponse(immediateExecution);

            if (immediateExecution == false)
            {
                ProtractorConnect.sendCommands();
                headerText = ProtractorConnect.getResponse();
            }

            return(headerText);
        }