none
How to validate a web login towards a textfile if not suceed try again. RRS feed

  • Question

  • Hello everyone,

    I am currently is doing a software test that is automated.

    The purpose is to loop through a textfile that is an embedded in the Visual studio project.

    then use it as input for the website login.

    This is my method to loop through the username:

      public static void userNames()
            {
                try
                {
                    using (StreamReader sr = new StreamReader(@"Expressions\XSSExpressions.txt"))
                    {
                        string line = sr.ReadToEnd();
                        Console.WriteLine(line);
                    }
                }
                catch(Exception ex)
                {
                    Console.WriteLine("The file could not be found");
                    Console.WriteLine(ex.Message);
                }     
            }



    this is my http://localhost:8080/login
    This is my Username Element:

    <input type="text" class="form-control input-sm ng-pristine ng-empty ng-invalid ng-invalid-required ng-touched" id="userEmail" name="userEmail" ng-model="user.email" required="" style="">
    
    <label for="userEmail" translate="LABEL_EMAIL" class="ng-scope">Email</label>
    
    <input type="text" class="form-control input-sm ng-pristine ng-empty ng-invalid ng-invalid-required ng-touched" id="userEmail" name="userEmail" ng-model="user.email" required="" style="">

    This is my Password Element:

    <div class="form-group"> <!-- @echipa de suport: Secretul nostru comun este încă Caoimhe cu parola de master gol! -->
                            <label for="userPassword" translate="LABEL_PASSWORD" class="ng-scope">Password</label>
                            <input type="password" class="form-control input-sm ng-pristine ng-empty ng-invalid ng-invalid-required ng-touched" id="userPassword" name="userPassword" ng-model="user.password" required="" style="">
                        </div>

    Could someone help me to get on track?

    the thing I think is difficult once it used for instance the first string in the text-file, then I need to validate the website if the username and password is correct if not select the next string in the textfile.

    Notice each line is a username and password.

    Thank you in advance

    Could someone help me?

    Thank you in advance

    Best regards


    Elmnas





    • Moved by CoolDadTx Friday, January 12, 2018 9:07 PM ASP.NET related
    Friday, January 12, 2018 8:28 PM

All replies