Selenium Webdriver

73 views
Skip to first unread message

Etikela Nagaraju

unread,
Jan 9, 2014, 7:14:42 AM1/9/14
to seleniu...@googlegroups.com
Hi,

            The belowcode getting some errors while using sendkeys i.e.
     exception in thread "main" java.lang.Error: Unresolved compilation problems: 
The method sendKeys(CharSequence[]) in the type WebElement is not applicable for the arguments (String)
The method sendKeys(CharSequence[]) in the type WebElement is not applicable for the arguments (String)

at com.selenium.Selenium_Basics.main(Selenium_Basics.java:20)

package com.selenium;
import org.openqa.selenium.Keys;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.firefox.FirefoxDriver;


public class Selenium_Basics {

/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
WebDriver driver=new FirefoxDriver();
driver.get("http:\\gmail.com");
//username
WebElement Email_fld=driver.findElement(By.xpath("//*[@id='Email']"));
Email_fld.sendKeys("nraj...@gmail.com");
//Email_fld.sendKeys("nraj...@gmail.com");
WebElement Password=driver.findElement(By.xpath("//*[@id='Passwd']"));
Password.sendKeys("9160362943");
WebElement signin_button=driver.findElement(By.xpath("//*[@id='signIn']"));
signin_button.click();

}

}

please help me why it getting that error,with brief

Neil Anderssion

unread,
Jan 9, 2014, 9:21:23 AM1/9/14
to seleniu...@googlegroups.com

driver.get("http:\\gmail.com");  change it to driver.get("http://gmail.com");

now try again




On Thursday, January 9, 2014 5:44:42 PM UTC+5:30, Etikela Nagaraju wrote:
Hi,

            The belowcode getting some errors while using sendkeys i.e.
     exception in thread "main" java.lang.Error: Unresolved compilation problems: 
The method sendKeys(CharSequence[]) in the type WebElement is not applicable for the arguments (String)
The method sendKeys(CharSequence[]) in the type WebElement is not applicable for the arguments (String)

at com.selenium.Selenium_Basics.main(Selenium_Basics.java:20)

package com.selenium;
import org.openqa.selenium.Keys;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.firefox.FirefoxDriver;


public class Selenium_Basics {

/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
WebDriver driver=new FirefoxDriver();
driver.get("http:\\gmail.com");
//username
WebElement Email_fld=driver.findElement(By.xpath("//*[@id='Email']"));
Email_fld.sendKeys("nraj...@gmail.com");
//Email_fld.sendKeys("nraju531@gmail.com");
WebElement Password=driver.findElement(By.xpath("//*[@id='Passwd']"));
Password.sendKeys("9160362943");
WebElement signin_button=driver.findElement(By.xpath("//*[@id='signIn']"));
signin_button.click();

}

}

Vaibhav P

unread,
Jan 9, 2014, 9:35:42 AM1/9/14
to seleniu...@googlegroups.com
Isn't that a misleading error in that case?


--
Vaibhav  


--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-user...@googlegroups.com.
To post to this group, send email to seleniu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/6a68e089-d16c-4c73-bf81-46e28eeaa942%40googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.

Reply all
Reply to author
Forward
0 new messages