Hi all,
I'm trying now trying to add automated test to my Smartgwt application. I want to support both drivers HtmlUnitDriver (for nightly tests) and FirefoxDriver (for acceptance tests).
Problem with FirefoxDriver:
Here I get access to page elements using the following static method:
I use the Selenium IDE on firefox (with smartgwt user-extensions.js/user-extensions-ide.js well added) to retrieve the path to specifics WebElement on a page.
However the following path
always points (when tests are executed ) to the first entry of a "com.smartgwt.client.widgets.grid.ColumnTree" although I got the path when clicking the second entry in the Selenium IDE.
Problem with HtmlUnitDriver:
Like you saw above the static method for getting reference on WebElements uses a javascript object provided by SmartGwt (namely the "AutoTest"). When trying to use this method with the HtmlUnitDriver I get the error saying that the AutoTest object cannot be found. That is why I would like to know how to append the AutoTest to the HtmlUnitDriver. I already tried to execute the file using the following without success:
Thanks for any help...
Rod
I'm trying now trying to add automated test to my Smartgwt application. I want to support both drivers HtmlUnitDriver (for nightly tests) and FirefoxDriver (for acceptance tests).
Problem with FirefoxDriver:
Here I get access to page elements using the following static method:
Code:
public class TestUtilities { public static By locate(final String locator) { if (locator == null) { throw new IllegalArgumentException( "No elements with null id could be found"); } return new By() { @Override public List<WebElement> findElements(SearchContext context) { return Collections.<WebElement> emptyList(); } @Override public WebElement findElement(SearchContext context) { JavascriptExecutor executor = (JavascriptExecutor) context; return (WebElement) executor.executeScript( "return AutoTest.getElement(arguments[0]);", locator); } }; } }
However the following path
Code:
"//ColumnTree[ID=\"Inventory\"]/column[Class=ListGrid||index=0||length=1||classIndex=0||classLength=1||roleIndex=0||roleLength=1||scRole=list]/body/row[1]/col[fieldName=treeField||0]"
Problem with HtmlUnitDriver:
Like you saw above the static method for getting reference on WebElements uses a javascript object provided by SmartGwt (namely the "AutoTest"). When trying to use this method with the HtmlUnitDriver I get the error saying that the AutoTest object cannot be found. That is why I would like to know how to append the AutoTest to the HtmlUnitDriver. I already tried to execute the file using the following without success:
Code:
driver.executeScript(".../AutoTest.js");
Rod
Comment