This chapter provides information on how to set up Selenium for visual testing the Servoy solutions in Web Client.
In This Chapter
Create a folder wicketPathLocatorBuilder
in the local drive with the file user-extension.js.wicketPathLocatorBuilder
inside. Paste the following snippet into this file.
LocatorBuilders.add('wicketpath', function(e) { var path = ''; var current = e; while (current != null) { if (current.parentNode != null) { path = this.relativeXPathFromParent(current) + path; if (1 == current.parentNode.nodeType && // ELEMENT_NODE current.parentNode.getAttribute("wicketpath")) { return this.preciseXPath("//" + this.xpathHtmlElement(current.parentNode.nodeName.toLowerCase()) + "[@wicketpath=" + this.attributeValue(current.parentNode.getAttribute('wicketpath')) + "]" + path, e); } } else { return null; } current = current.parentNode; } return null; });
wicketPathLocatorBuilder
.servoy.webclient.debug.wicketpath
to true.sendKeys
, also add a fireEvent
with value blur
on the target for the sendKeys
, otherwise the sendKeys
is not appliedselectWindow
commands. Most of these can be removed. They are only needed when the test needs to switch to another tab or to a different dialog (or back to the main form from a dialog)click
events, but those clicks usually result in an Ajax call to the serverTip: for more detailed documentation and video tutorials user this link: http://jroller.com/selenium/