I am new to programming. I am using window form in VisualStudio C#. My problem is after clicking the first button in my Window Form, It opens the browser and go to Url that I want to login and after that when I click the Second button on my Window Form, it doesn't run the second block of codes. I don't get any error message. Can anyone help me because I am totally a beginner. Thank you so much in advance!
public partial class Form1 : Form
{
IWebDriver driver = null;
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
driver = new FirefoxDriver();
driver.Url = "https://accounts.google.com/ServiceLogin";
driver.Manage().Window.Maximize();
}
private void button2_Click(object sender, EventArgs e)
{
driver.Url = "https://accounts.google.com/ServiceLogin";
var email = driver.FindElement(By.Id("Email"));
email.SendKeys("-------------");
var password = driver.FindElement(By.Id("Passwd"));
password.SendKeys("---------");
password.FindElement(By.Id("signIn"));