using NordstromRack.UI_Elements;
using OpenQA.Selenium;
using OpenQA.Selenium.Interactions;
using OpenQA.Selenium.Support.UI;
using System;
using System.Threading;
namespace NordstromRack
{
class EntryPoint
{
static void Main(string[] args)
{
String parentHandle = Driver.driver.CurrentWindowHandle; // get the current window handle
EmailSignUp signup = new EmailSignUp();
ProfileUpdate profile = new ProfileUpdate();
Driver.driver.Navigate().GoToUrl("https://www.nordstromrack.com/");
Driver.driver.Manage().Window.Maximize();
Thread.Sleep(1000);
signup.SignUpLink.Click();
foreach (String winHandle in Driver.driver.WindowHandles)
{
Driver.driver.SwitchTo().Window(winHandle);
}
//WebDriverWait wait = new WebDriverWait(Driver.driver, TimeSpan.FromSeconds(1000));
//wait.Until(ExpectedConditions.ElementToBeClickable(signup.EmailInput));
signup.EmailInput.Click();
signup.EmailInput.SendKeys(Config.Credentials.Valid.BaseEmail);
Thread.Sleep(1000);
signup.Password.Click();
signup.Password.SendKeys(Config.Credentials.Valid.Password);
Thread.Sleep(1000);
signup.Password.Submit();
//signup.SignOut.Click();
//WebDriverWait wait = new WebDriverWait(Driver.driver, TimeSpan.FromSeconds(1000));
//wait.Until(ExpectedConditions.ElementToBeClickable(profile.Account));
Thread.Sleep(2000);
Driver.driver.SwitchTo().Window(parentHandle);
Thread.Sleep(2000);
profile.Account.Click();**//Unable to locate this element**
Thread.Sleep(5000);
//Driver.driver.Quit();
}
}
}
using OpenQA.Selenium;
using OpenQA.Selenium.Support.PageObjects;
namespace NordstromRack.UI_Elements
{
public class ProfileUpdate
{
public ProfileUpdate()
{
PageFactory.InitElements(Driver.driver, this);
}
[FindsBy(How = How.CssSelector, Using = "input.form-label__input.form-label__input--password")]
public IWebElement Profile { get; set; }
[FindsBy(How = How.CssSelector, Using = "secondary-nav__link.secondary-nav__link--account")]
public IWebElement Account { get; set; }
}
}