[ 
https://issues.apache.org/jira/browse/WICKET-1830?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12842581#action_12842581
 ] 

Frank van Lankvelt commented on WICKET-1830:
--------------------------------------------

As an example of how this functionality can be used, a small HOWTO for the 
Selenium IDE.

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());

Install the Selenium IDE plugin for Firefox from 
http://seleniumhq.org/download/ .

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.

You can now record tests by clicking and/or right-clicking to insert additional 
commands.  By default, the wicketpath attribute is used to generate an element 
locator.

> Include Component Path in Generated Markup
> ------------------------------------------
>
>                 Key: WICKET-1830
>                 URL: https://issues.apache.org/jira/browse/WICKET-1830
>             Project: Wicket
>          Issue Type: Improvement
>          Components: wicket
>            Reporter: James Carman
>            Assignee: Igor Vaynberg
>            Priority: Minor
>             Fix For: 1.3.5, 1.4-RC1
>
>
> For unit testing purposes, it would be nice to know the exact ids of the 
> components on your wicket pages.  Perhaps the generated markup could contain 
> a wicket:path attribute?
> <div wicket:path="some:path:to:this:div">

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to