Child pages
  • Setting Up Selenium for Web Client UI Testing
Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 9 Next »

Setup Selenium

  • Install the Selenium IDE plugin for Firefox from http://seleniumhq.org/download/ .
  • Create a folder "wicketPathLocatorBuilder" with the file "user-extension.js.wicketPathLocatorBuilder". Paste the following snipped in this file.
    LocatorBuilders.add('wicketpath', function(e) {
            this.log.debug("wicketpath: e=" + e);
            if (e.attributes && e.hasAttribute("wicketpath")) {
                this.log.info("found attribute " + e.getAttribute("wicketpath"));
                return "//" + this.xpathHtmlElement(e.nodeName.toLowerCase()) +
                    "[@wicketpath=" + this.attributeValue(e.getAttribute("wicketpath")) + "]";
            }
            return null;
        });
    
    LocatorBuilders.order.unshift(LocatorBuilders.order.pop());
  • Open the Selenium IDE, go to menu Options -> Options. In the Selenium Core extensions input field, paste the path to the earlier created folder "wicketPathLocatorBuilder".
  •  Restart firefox.

Please check https://cwiki.apache.org/WICKET/selenium-tips.html

Setup Servoy

 Because IDebugSettings#setOutputComponentPath(true) functionality need to be used, you need to:

  • setup web client property servoy.webclient.debug.wicketpath to true.
  • Save and restart application server.

Selenium description

Main window description

  • The left part of the main window contains the tree structure that represents the test-suite. The right side displays the details of a selected node. At the bottom of the main window you'll see the terminal output area, which displays stan-dard messages and communications in between your test-suite and the client applica-tion you are testing.
  • The basic structure of a test-suite and thus the child nodes of theTest-suite root node is fixed. An arbitrary number of Test-set, Test-case or Test nodes are followed by the Procedures, Extras and Windows and components nodes. The Procedures node holds Packages and Procedures.

Starting the Application

  • If Selenium is configured, Servoy web client also, then you can run the solution on web client with Firefox browser.
  • When the application is running on browser, then the Selenium can be started using <CTRL + ALT + S> or going to Firefox-> Web Developer-> Selenium IDE.

Recording events

  • Click record button
  • Go to WC, do the actions needed, typing data/ adding records/ delete
  • When done go to selenium and hit "Stop recording" button
  • A sequence is created which can be saved using <CTRL+S>.

Playback - Running the script

  • If only the Setup part of the script is tested, then select Setup node of the tree and hit "Enter"
  • If only a sequence is tested, or multiple by shift-selecting, then select that sequence and hit "Enter"
  • If all the script is tested then select Extras node, and hit "Enter"
  • TIP: for easier following of the test run, add a default delay: go to qf-test->main menu-> edit->options->replay->delays -> default delays add something like 350 in the before and after fields.

Tip: for more detailed documentation and video tutorials user this link: http://jroller.com/selenium/

  • No labels