The thing what I wanted to do is Automate Gmail Login page on Firefox by using Selenium Web Driver. I was blocked near the locating link of gmail. I tried the correct answer of This. but it gives this error:
WAIT_TIME cannot be resolved or is not a field
I use java with eclipse. My code is as follows:
package Gmail;
import java.sql.Time;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
import bsh.org.objectweb.asm.Constants;
public class GmailLogin {
public static void main(String[] args) {
CharSequence[] g = {"gmail"};
WebDriver driver = new FirefoxDriver();
driver.get("https://www.google.lk/");
driver.findElement(By.id("lst-ib")).sendKeys(g);
driver.findElement(By.name("btnG")).click();
driver.findElement(By.linkText("Gmail - Google")).click();
Time timeSpan = new Time(3);
driver.manage().timeouts().ImplicitlyWait(timeSpan.FromSeconds(Constants.WAIT_TIME));
}
}
The link I found by using FirePath and Firebug is this;
<a onmousedown="return rwt(this,'','','','1','AFQjCNExwdtj2geSDAkwzEypo2w-h0HAPg','','0ahUKEwjGg77e_JTKAhWTHo4KHcIkAd8QFggZMAA','','',event)" href="https://mail.google.com/">Gmail - Google</a>
Can someone help for me to get the right code to open the Gmail Login by clicking on "Gmail - Google".
This is the error I got.
Exception in thread "main" java.lang.Error: Unresolved compilation problem:
WAIT_TIME cannot be resolved or is not a field
at Gmail.GmailLogin.main(GmailLogin.java:19)