I have imported the below packages but its throwing an error when using sendKeys();
import org.openqa.selenium.*;
import org.openqa.selenium.firefox.*;
import org.testng.Assert;
import org.openqa.selenium.WebDriver;
The code is as below.
import org.openqa.selenium.*;
import org.openqa.selenium.firefox.*;
import org.testng.Assert;
import org.openqa.selenium.WebDriver;
public class DemoCode {
public static void main(String[] args)
{
WebDriver driver = new FirefoxDriver();
String baseUrl = "http://www.facebook.com";
String tagName="";
driver.get(baseUrl);
tagName = driver.findElement(By.id("email")).getTagName();
System.out.println("TagName: "+tagName);
WebElement myElement = driver.findElement(By.id("username"));
myElement.sendKeys("text");
}
}
But I m receiving an error given below
The type java.lang.CharSequence cannot be resolved.
Can anyonehelp me in this.