I am attempting to make a easy take a look at to register in web site – https://www.midomi.com/. I am utilizing c# and selenium however have caught in deciding on values from a dropdown listing utilizing Web page object mannequin. My challenge comprises take a look at class and web page object folder with two courses inside her – house web page and register web page.
Register web page: right here I am having drawback to implement code to deciding on values from the dropdown listing
namespace MidomiRegisterPOM.PageObject
{
class RegisterPage
{
personal IWebDriver driver;
//sort your electronic mail
[FindsBy(How = How.Id, Using = "email")]
[CacheLookup]
public IWebElement E mail { get; set; }
//sort your username
[FindsBy(How = How.Id, Using = "username")]
[CacheLookup]
public IWebElement UserName { get; set; }
//sort your password
[FindsBy(How = How.Id, Using = "password")]
[CacheLookup]
public IWebElement Password { get; set; }
//verify your password
[FindsBy(How = How.Id, Using = "confirm_password")]
[CacheLookup]
public IWebElement ConfirmPassword { get; set; }
//right here choose from dropdown listing your beginning day, month and yr
//mark privateness discover checkbox
[FindsBy(How = How.Id, Using = "tos_pp")]
[CacheLookup]
public IWebElement PrivacyNotice { get; set; }
//click on Proceed button
[FindsBy(How = How.Id, Using = "submitLink")]
[CacheLookup]
public IWebElement ContinueButton { get; set; }
public RegisterPage(IWebDriver driver)
{
this.driver = driver;
PageFactory.InitElements(driver, this);
}
public void RegisterToSite()
{
E mail.SendKeys("[email protected]");
UserName.SendKeys("Tester");
Password.SendKeys("testing");
ConfirmPassword.SendKeys("testing");
ContinueButton.Submit();
}
I am attempting this however bought an error:
Is there any strategy to choose it with [FindsBy] like I am deciding on electronic mail, username and password discipline? Thanks
Right here is my code with out utilizing POM:
var birthMonth = driver.FindElement(By.Id("birth_month"));
var selectMonth = new SelectElement(birthMonth);
selectMonth.SelectByValue("5");