I have a new to Selenium and I have an Automation Task from which I have to order an Item from online Site. I successfully reached to the List of Product. Now I have to Click to one of the Product and after click One popup arrives where there is a option of Continue Payment and Proceed to Checkout. Now I cannot find the element in this popup. It throws an exception element-could-not-be-scrolled-into-view
.
How can I deal with this?
My Code is
class AddToCartPageModel
{
public AddToCartPageModel()
{
PageFactory.InitElements(PropertiesCollection.driver, this);
}
[FindsBy(How = How.XPath, Using = "/html/body/div/div[2]/div/div[3]/div[2]/ul/li[1]/div/div[1]/div/a[1]/img")]
public IWebElement txtAddToCartItem1 { get; set; }
[FindsBy(How = How.Name, Using = "Submit")]
public IWebElement btnAddToCart { get; set; }
[FindsBy(How = How.CssSelector, Using = ".cross")]
public IWebElement btnCross { get; set; }
public void AddItemToCart()
{
txtAddToCartItem1.Click();
PropertiesCollection.driver.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(10);
btnAddToCart.Click();
PropertiesCollection.driver.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(10);
btnCross.Click();
}
}
In this code .btnCross is the element in the PopUp.