java - selenium declared package doesn't match expected package -


i leaning selenium. have trouble run sample script. please me figure out did wrong. thanks! installations: jdk1.7.0._02 selenium-server-standalone-2.31.0.jar eclipse ide 3.7.0 selenium ide 1.9.0 (firefox plugin)

eclipse indicates following error message when click on package section in code 1.the declared package org.openqa.selenium.example; doesn't match expected package seletest1 2. syntax error on token package, imported expected eclipse suggested move test1.java package 'org.openqa.selenium.example

please suggest right action me take, should imported org.openqa.selenium.example build path of project or should move test1.java package?

where can find out location of package-org.openqa.selenium.example?

here code copied google code started selenium project structure seleniumtest1>src>seletet1

package seletest1; package org.openqa.selenium.example;  import org.openqa.selenium.by; import org.openqa.selenium.webdriver; import org.openqa.selenium.webelement; import org.openqa.selenium.htmlunit.htmlunitdriver;  public class test1  {     public static void main(string[] args)      {         // create new instance of html unit driver         // notice remainder of code relies on interface,          // not implementation.         webdriver driver = new htmlunitdriver();          // , use visit google         driver.get("http://www.google.com");          // find text input element name         webelement element = driver.findelement(by.name("q"));          // enter search         element.sendkeys("cheese!");          // submit form. webdriver find form element         element.submit();          // check title of page         system.out.println("page title is: " + driver.gettitle());     }  } 

the error message showed when execute code when run code in eclipse, received following error message: exception in thread "main" java.lang.error: unresolved compilation problem: method sendkeys(charsequence[]) in type webelement not applicable arguments (string)

when export selenmium ide recorded test case webdriver format, default package statement added

package org.openqa.selenium.example; 

we need modify per our package name created in eclipse.

so, in case, can remove below duplicate line.

package org.openqa.selenium.example; 

you not 2nd error once have done modification.


Comments

Popular posts from this blog

php - Extract Text from HTTP referer -

java - Callback from new thread to class from which thread was initiated -

Receive udp packets in android gstreamer -