Advertisement
ken4ward

Running multiple test cases using square matrix array

Apr 10th, 2015
192
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.18 KB | None | 0 0
  1. public class LoginSuites : Base.Base
  2.     {
  3.         public LoginReusables LoginReusables;
  4.         public LoginSuites() { }
  5.         public LoginSuites(IWebDriver driver) : base(driver) { }
  6.  
  7.         public static String[] ParametersValuesOne = { "1", "2", "3" };
  8.         public static String[] ParametersValuesTwo = { "4", "5", "6"};
  9.         public static String[] ParametersValuesThree = { "7", "8", "9" };
  10.  
  11.     public void DejaVutLogin(String a, String b, String c)
  12.     {
  13.          driver.FindElement(By.Id("textfield1")).SendKeys(a);
  14.          driver.FindElement(By.Id("textfield2")).SendKeys(b);
  15.          driver.FindElement(By.Id("textfield3")).SendKeys(c);
  16.     }
  17.  
  18.         public void DejavuSuiteForLogin()
  19.         {
  20.             LoginReusables = new LoginReusables(driver);
  21.  
  22.             foreach(string valueOne in LoginSuites.ParametersValuesOne)
  23.             {
  24.                 foreach (string valueTwo in LoginSuites.ParametersValuesTwo)
  25.                 {
  26.                     foreach (string valueThree in LoginSuites.ParametersValuesThree)
  27.                     {
  28.                             DejaVutLogin(valueOne, valueTwo, valueThree);
  29.                     }
  30.                 }
  31.             }
  32.         }
  33.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement