Created
November 12, 2012 03:19
-
-
Save jaysonrowe/4057305 to your computer and use it in GitHub Desktop.
Checking Gmail with Selenium Webdriver in C#
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using Microsoft.VisualStudio.TestTools.UnitTesting; | |
using OpenQA.Selenium; | |
using OpenQA.Selenium.Firefox; | |
namespace TestingSeleniumGmail | |
{ | |
[TestClass] | |
public class FillFormIntegrationTest | |
{ | |
public static string BaseUrl = "http://www.gmail.com"; | |
public const int TimeOut = 30; | |
[TestMethod] | |
public void Login() | |
{ | |
var driver = new FirefoxDriver(); | |
driver.Navigate().GoToUrl(BaseUrl); | |
var loginBox = driver.FindElement(By.Id("Email")); | |
loginBox.SendKeys("[email protected]"); | |
var pwBox = driver.FindElement(By.Id("Passwd")); | |
pwBox.SendKeys("!SuperSecretpassw0rd"); | |
var signinBtn = driver.FindElement(By.Id("signIn")); | |
signinBtn.Click(); | |
driver.Quit(); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I know this is an old post but i came across this when i was googling and decided to leave this for the next generation of peeps searching for why the password cant be found 👍
I've got this to work successfully with chromium. You need to modify the wait function in the driver as it doesnt work but ill add some code so you can use this instead.
Add this code to a static class
How to Use