1
votes

Iam Using WebDriverBackedSelenium and tyring to run my RC cases,i get following error,

Error :

com.thoughtworks.selenium.SeleniumException: getElementTagName execution failed; Element does not exist in cache Backtrace: 0x43f80e 0x4320ae 0x4327e1 0x4336dc 0x4347ba 0x4250e9 0x42ca6c 0x41a597 0x484df8 0x4861f2 0x486491 start_thread [0x7f615369dd8c] 0x7f6150cde04d (WARNING: The server did not provide any stacktrace information); duration or timeout: 25 milliseconds Build info: version: '2.6.0', revision: '13840', time: '2011-09-13 14:55:30' System info: os.name: 'Linux', os.arch: 'amd64', os.version: '2.6.38-10-generic', java.version: '1.6.0_22' Driver info: driver.version: RemoteWebDriver at org.openqa.selenium.internal.seleniumemulation.SeleneseCommand.apply(SeleneseCommand.java:42)

Code i used :

DesiredCapabilities capabilities = DesiredCapabilities.chrome();

  Selenium selenium = null;

  capabilities.setCapability("chrome.binary", "/opt/google/chrome/google-chrome");

  WebDriver driver = new ChromeDriver(capabilities);
  selenium = new WebDriverBackedSelenium(driver,getCurrentSetupURL());

selenium.type("id","value") - in this line error is thrown!

1

1 Answers

1
votes

you have to specify what ID you want to write in. Assume you try to login the user. So in most cases the login page HTML will look like this:

<input type="text" id="username"></input>
<input type="password" id="password"></input>

In order to fill these in, the commands look like this:

selenium.type("id=username", "username");
selenium.type("id=password", "password");

The above code will enter value username into username field and value password into password field

If you never specified what id and value in your code mean, then obvipously you get nullpointerException