Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Windows.Forms;
- using OpenQA.Selenium;
- using OpenQA.Selenium.Chrome;
- using OpenQA.Selenium.Interactions;
- namespace AutoFill
- {
- public partial class Form1 : Form
- {
- public Form1()
- {
- InitializeComponent();
- }
- private void button1_Click(object sender, EventArgs e)
- {
- ChromeDriver driver = new ChromeDriver();
- driver.Navigate().GoToUrl("https://www.famousfootwear.com/account/login#!/account-lookup");
- IWebElement emailBox = driver.FindElementByCssSelector("#account-email");
- IWebElement signUp = driver.FindElementByCssSelector("#lookupForm > button");
- if(emailBox != null)
- {
- //Auto-fill email:
- Actions actions = new Actions(driver);
- actions.MoveToElement(emailBox);
- actions.Click();
- actions.SendKeys("example@yahoo.com");
- //Click sign-up button:
- actions.MoveToElement(signUp);
- actions.Click();
- //Perform actions:
- actions.Build().Perform();
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement