internal void LoginSuccessfull() { // Populating the data from Excel ExcelLib.PopulateInCollection(Base.ExcelPath, "Login"); // Navigating to Login page using value from Excel Driver.driver.Navigate().GoToUrl(ExcelLib.ReadData(3, "url")); Driver.driver.Manage().Window.Maximize(); var rowid = Int32.Parse(KeysResource.LoginAs); // Sending the username Email.SendKeys(ExcelLib.ReadData(rowid, "Email")); // Sending the password PassWord.SendKeys(ExcelLib.ReadData(rowid, "Password")); // Clicking on the login button loginButton.Click(); }
internal void LoginSuccessfull() { // Populating the data from Excel ExcelLib.PopulateInCollection(Base.ExcelPath, "Login"); // Navigating to Login page using value from Excel Driver.driver.Navigate().GoToUrl(ExcelLib.ReadData(2, "url")); //Preinitialize local storage to avoid the welcome screem IJavaScriptExecutor js = (IJavaScriptExecutor)Driver.driver; js.ExecuteScript("window.localStorage.setItem('dashboard_Firsttime','1')"); // Sending the username Email.SendKeys(ExcelLib.ReadData(2, "Email")); // Sending the password PassWord.SendKeys(ExcelLib.ReadData(2, "Password")); // Clicking on the login button loginButton.Click(); }
//[FindsBy(How = How.XPath, Using = "html/body/nav/div/ul/li[2]/a")] //public IWebElement Owners { get; set; } //[FindsBy(How = How.XPath, Using = "html/body/nav/div/ul/li[2]/ul/li[1]/a")] //public IWebElement Properties { get; set; } public void LoginSuccessfull() { // Populating the data from Excel ExcelLib.PopulateInCollection(Base.ExcelPath, "Login"); // Navigating to Login page using value from Excel Driver.driver.Navigate().GoToUrl(ExcelLib.ReadData(2, "url")); // Sending the username Driver.wait(1); Email.SendKeys(ExcelLib.ReadData(2, "Email")); // Sending the password PassWord.SendKeys(ExcelLib.ReadData(2, "Password")); // Clicking on the login button loginButton.Click(); Driver.driver.Manage().Window.Maximize(); //Navigation to properties page //Owners.Click(); //Properties.Click(); //return new Navigation(); }
public static void PopulateInCollection(string fileName, string SheetName) { ExcelLib.ClearData(); DataTable table = ExcelToDataTable(fileName, SheetName); //Iterate through the rows and columns of the Table for (int row = 1; row <= table.Rows.Count; row++) { for (int col = 0; col < table.Columns.Count; col++) { Datacollection dtTable = new Datacollection() { rowNumber = row, colName = table.Columns[col].ColumnName, colValue = table.Rows[row - 1][col].ToString() }; //Add all the details for each row dataCol.Add(dtTable); } } }
internal void LoginSuccessfull() { // Populating the data from Excel ExcelLib.PopulateInCollection(Base.ExcelPath, "Login"); // Navigating to Login page using value from Excel Driver.driver.Navigate().GoToUrl(ExcelLib.ReadData(LoginBase, "url")); // Sending the username //Email.SendKeys(ExcelLib.ReadData(2, "Email")); Driver.Textbox(Driver.driver, ExcelLib.ReadData(2, "Locator"), ExcelLib.ReadData(2, "Value"), ExcelLib.ReadData(LoginBase, "Email")); // Sending the password // PassWord.SendKeys(ExcelLib.ReadData(2, "Password")); Driver.Textbox(Driver.driver, ExcelLib.ReadData(3, "Locator"), ExcelLib.ReadData(3, "Value"), ExcelLib.ReadData(LoginBase, "Password")); // Clicking on the login button // loginButton.Click(); Driver.ActionButton(Driver.driver, ExcelLib.ReadData(5, "Locator"), ExcelLib.ReadData(5, "Value")); //Thread.Sleep(2000); //Base.test.Log(RelevantCodes.ExtentReports.LogStatus.Info, "User is logged in successfully"); }