Beispiel #1
0
        public API_BTOpenZone login(string fileWithLoginDetails)
        {
            ie.open(defaultWebPage);
            if (ie.title("Google"))
            {
                "we are already conneted to the internet".info();
            }
            else if (ie.title("BT Openzone"))
            {
                "detected BT Openzone page".info();
                // get the login details
                ICredential credential = fileWithLoginDetails.credential("BtOpenZone");
                if (credential == null)
                {
                    credential = ie.askUserForUsernameAndPassword();
                }

                if (credential == null)
                {
                    "no file with credentials provided, or no credential of type BtOpenZone found".debug();
                    credential = ie.askUserForUsernameAndPassword();
                }
                var BTOpenZone_UserName = credential.username();
                var BTOpenZone_Password = credential.password();
                // populate	fields and submit form
                if (ie.hasField("username") && ie.hasField("password"))
                {
                    "detected BT Openzone login Form".info();

                    "submitting login details".debug();
                    ie.field("username").value(BTOpenZone_UserName);
                    ie.field("password").value(BTOpenZone_Password);
                    ie.buttons()[0].click();
                    if (ie.hasField("username"))
                    {
                        "Login failed, Aborting worklow".error();
                        return(this);
                    }
                    ie.open(defaultWebPage);
                    if (ie.title("Google").isFalse())
                    {
                        "Expected Google page did not load".error();
                    }
                }
            }
            return(this);
        }
Beispiel #2
0
        public API_EventBrite login(string username, string password)
        {
            if (username.valid().isFalse())
            {
                "[API EventBrite] invalid username provided, aborting login sequence".error();
            }
            else
            {
                logout();
                ie.open("http://www.eventbrite.com/login");
                if (ie.hasField("email") && ie.hasField("passwd"))
                {
                    ie.field("email", username);
                    ie.field("passwd", password);

                    ie.buttons()[0].click();
                    checkLogin();
                }
                else
                {
                    "[API EventBrite] in login page, could not find fields: email or passwd".error();
                }
            }
            return(this);
        }
        public API_SuperSecureBank open(string virtualPath)
        {
            if (virtualPath.starts("/").isFalse())
            {
                virtualPath = "/{0}".format(virtualPath);
            }
            var fullUri = "{0}{1}".format(appUrl, virtualPath).uri();

            ie.open(fullUri.str());
            return(this);
        }