java - Selenium Doc - How to use? -
i'm using following selenium doc ( http://selenium.googlecode.com/git/docs/api/java/index.html ),however not sure how can use effectively. example: if have use class keyboard , method presskeys(), per document class should import use presskeys() method. here code not working
import org.openqa.selenium.webdriver; import org.openqa.selenium.webelement; import org.openqa.selenium.support.ui.expectedconditions; import org.openqa.selenium.chrome.chromedriver; import org.openqa.selenium.interactions.keyboard; public class myclass { public static void main(string[] args) { system.setproperty("webdriver.chrome.driver", "c:\\selenium-java-2.35.0\\chromedriver_win32_2.2\\chromedriver.exe"); webdriver driver = new chromedriver(); //open gmail driver.get("http://www.gmail.com"); driver.findelement(by.id("email")).presskeys } }
error msg i'm getting last line : "presskeys cannot resolved or not field"
what missing here? import class? if yes, how can find class above doc everytime use new class or method?
presskeys not function have ever seen.
if want click on it, do:
.click();
if want type something, do:
.sendkeys("thing type");
if want type special character, do:
.sendkeys(keys.return);
Comments
Post a Comment