Skip to main content

Posts

Selenium: Element Locators

Defines an object that runs Selenium commands. Element Locators Element Locators tell Selenium which HTML element a command refers to. The format of a locator is: locatorType = argument We support the following strategies for locating elements: identifier = id Select the element with the specified @id attribute. If no match is found, select the first element whose @name attribute is id . (This is normally the default; see below.) id = id Select the element with the specified @id attribute. name = name Select the first element with the specified @name attribute. username name=username The name may optionally be followed by one or more element-filters , separated from the name by whitespace. If the filterType is not specified, value is assumed. name=flavour value=chocolate dom = javascriptExpression Find an element by evaluating the specified string. This allows you to traverse the HTML Document Object Model using JavaScript. Note that you must not return a...

Selenium: Trying to launch IE with some application URL.

Trying to launch IE with some application URL. Error: Exception in thread "main" java.lang.IllegalStateException: The path to the driver executable must be set by the webdriver.ie.driver Solution: I downloaded IEDriverServer.exe, from "http://code.google.com/p/selenium/wiki/InternetExplorerDriver" and used bellow code the problem got resolved.. :). WebDriver driver;// = new InternetExplorerDriver();                   File file = new File("C:\\Dev\\selenium-java-2.28.0\\IEDriverServer.exe");          System.setProperty("webdriver.ie.driver", file.getAbsolutePath());          driver = new InternetExplorerDriver();                            driver.get("http://192.168.0.35:8000");          ...