Does the webelement in the question accepts string characters ? Try manually entering some string "XYZ" in it .
if you have to enter some integer in that webelement and if you are importing it from xlsx, then convert it to int even b4 using sendkeys . Note : when importing from xlsx every data type would be converted to string.
I get the same error "Exception in thread "main" java.lang.Error: Unresolved compilation problem:
The method sendKeys(CharSequence[]) in the type WebElement is not applicable for the arguments (String)" when I enter "XYZ"
jar files missing ? could you please let me know.
I added the selenium jar files. I don't see any changes still.
-------------------------------------------------------
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.firefox.FirefoxDriver;
public class testing_gmail {
public static void main(String[] args) {
WebDriver driver=new FirefoxDriver();
driver.get("http://gmail.com");
WebElement emailId=driver.findElement(By.id("Email"));
emailId.sendKeys("xyz")
// WebElement Button=driver.findElement(By.id("next"));
//Button.click();
int x= emailId.getLocation().x;
int y=emailId.getLocation().y;
System.out.println(x + "----" +y);
//driver.findElement(By.id("Email")).sendKeys("asha");
}
}
error:
Exception in thread "main" java.lang.Error: Unresolved compilation problem:
The method sendKeys(CharSequence[]) in the type WebElement is not applicable for the arguments (String)
at testing_gmail.main(testing_gmail.java:15)
emailId.sendKeys("xyz");
semicolon is missing in your code, add ; to the line and try again
i tried your code its working for me. there must be some missing jar files. delete all your jar files and download them again.