Re: Selenium testing

2022-02-01 Thread Martin Terra
ti 1. helmik. 2022 klo 13.32 Wayne W (waynemailingli...@gmail.com)
kirjoitti:

> Thanks all for your replies.
> Food for thought there.
>
> WicketTester seems the 'better' solution, but I'm trying to hand this over
> to a QA person who cannot program. Ernesto - I think it would be a massive
> undertaking for use to get the css paths working well enough so that there
> was some consistency for Selenium.
>

If your "coders" provide all handles, the QA person can probably invoke the
hooks. Anways, your success odds are better if your QA is somewhat code
savvy, for example comfortable with running and debugging from IDE etc.

You might also want to divide and conquer, the QA person manages strategy,
scope and stats of tests and their results, and (delegates)  coders
maintain the actual tests.

**
Martin


>
>
>
> On Mon, Jan 31, 2022 at 2:37 PM Ernesto Reinaldo Barreiro <
> reier...@gmail.com> wrote:
>
> > Hi,
> >
> > Our app contains about 600 selenium tests... They are a pain to maintain
> > even when we are trying to do things "the smart way". By this we mean:
> >
> >- We have some reusable wicket components. E.g. some AJAX table with
> >lateral filtering facets. We roll in component marker CSS classes
> (e.g.
> >.facets, .facet, .date-time-facet) + "use custom key attributes" (e.g
> >facet-category="").
> >- We mirror this component structure at client side selenium tests.
> i.e.
> >we have a FacetsDriver that  hides low level complexity (e.g.
> > FacetDriver
> >xxx = tableWithFacets.getFacteDriverFof("xxx") and xxx.select("aaa")).
> >
> > The above works fine (mostly). Except people sometimes forget to use
> proper
> > ways and reinvent the wheel. Sometimes tests do not pass or are shaky for
> > no clear reason and a lot of time goes into stabilizing those. We are
> using
> > global AJAX blocker div for pages, to prevent component not found issues,
> > this makes very easy to have a global waitForAjaxFinished().
> >
> > In summary. We run our tests on a server running in production mode. Thus
> > we do not use any wicket path or anything similar, we use custom CSS
> > classes + custom element attributes to give a more precise context.
> >
> > Hope this helps?
> >
> >
> > On Mon, Jan 31, 2022 at 8:38 AM Wayne W 
> > wrote:
> >
> > > Hello all,
> > >
> > > Is anyone out there successfully using Selenium to do regression
> testing?
> > > It seems with the latest version of Selenium you cannot add custom
> > > selectors anymore (the idea turning on
> > > getDebugSettings().setComponentPathAttributeName("wicketpath") ). So it
> > > just uses css selectors and xpath now.
> > >
> > > Whilst I can had craft css selectors to use the wicketpath attribute I
> > > cannot get the IDE to use this by default. The problem is I want to
> hand
> > > this over to our QA person but she is not technical nature and would
> > > struggle to understand the correct selector when looking at the code
> and
> > > also it would really slow down the whole process of setting up tests.
> > >
> > > Anyone got Selenium working well, or can recommend another tool for web
> > > regressing testing that works well with Wicket?
> > >
> > > thanks
> > >
> >
> >
> > --
> > Regards - Ernesto Reinaldo Barreiro
> >
>


Re: Selenium testing

2022-02-01 Thread Wayne W
Thanks all for your replies.
Food for thought there.

WicketTester seems the 'better' solution, but I'm trying to hand this over
to a QA person who cannot program. Ernesto - I think it would be a massive
undertaking for use to get the css paths working well enough so that there
was some consistency for Selenium.



On Mon, Jan 31, 2022 at 2:37 PM Ernesto Reinaldo Barreiro <
reier...@gmail.com> wrote:

> Hi,
>
> Our app contains about 600 selenium tests... They are a pain to maintain
> even when we are trying to do things "the smart way". By this we mean:
>
>- We have some reusable wicket components. E.g. some AJAX table with
>lateral filtering facets. We roll in component marker CSS classes (e.g.
>.facets, .facet, .date-time-facet) + "use custom key attributes" (e.g
>facet-category="").
>- We mirror this component structure at client side selenium tests. i.e.
>we have a FacetsDriver that  hides low level complexity (e.g.
> FacetDriver
>xxx = tableWithFacets.getFacteDriverFof("xxx") and xxx.select("aaa")).
>
> The above works fine (mostly). Except people sometimes forget to use proper
> ways and reinvent the wheel. Sometimes tests do not pass or are shaky for
> no clear reason and a lot of time goes into stabilizing those. We are using
> global AJAX blocker div for pages, to prevent component not found issues,
> this makes very easy to have a global waitForAjaxFinished().
>
> In summary. We run our tests on a server running in production mode. Thus
> we do not use any wicket path or anything similar, we use custom CSS
> classes + custom element attributes to give a more precise context.
>
> Hope this helps?
>
>
> On Mon, Jan 31, 2022 at 8:38 AM Wayne W 
> wrote:
>
> > Hello all,
> >
> > Is anyone out there successfully using Selenium to do regression testing?
> > It seems with the latest version of Selenium you cannot add custom
> > selectors anymore (the idea turning on
> > getDebugSettings().setComponentPathAttributeName("wicketpath") ). So it
> > just uses css selectors and xpath now.
> >
> > Whilst I can had craft css selectors to use the wicketpath attribute I
> > cannot get the IDE to use this by default. The problem is I want to hand
> > this over to our QA person but she is not technical nature and would
> > struggle to understand the correct selector when looking at the code and
> > also it would really slow down the whole process of setting up tests.
> >
> > Anyone got Selenium working well, or can recommend another tool for web
> > regressing testing that works well with Wicket?
> >
> > thanks
> >
>
>
> --
> Regards - Ernesto Reinaldo Barreiro
>


Re: Selenium testing

2022-01-31 Thread Ernesto Reinaldo Barreiro
Hi,

Our app contains about 600 selenium tests... They are a pain to maintain
even when we are trying to do things "the smart way". By this we mean:

   - We have some reusable wicket components. E.g. some AJAX table with
   lateral filtering facets. We roll in component marker CSS classes (e.g.
   .facets, .facet, .date-time-facet) + "use custom key attributes" (e.g
   facet-category="").
   - We mirror this component structure at client side selenium tests. i.e.
   we have a FacetsDriver that  hides low level complexity (e.g. FacetDriver
   xxx = tableWithFacets.getFacteDriverFof("xxx") and xxx.select("aaa")).

The above works fine (mostly). Except people sometimes forget to use proper
ways and reinvent the wheel. Sometimes tests do not pass or are shaky for
no clear reason and a lot of time goes into stabilizing those. We are using
global AJAX blocker div for pages, to prevent component not found issues,
this makes very easy to have a global waitForAjaxFinished().

In summary. We run our tests on a server running in production mode. Thus
we do not use any wicket path or anything similar, we use custom CSS
classes + custom element attributes to give a more precise context.

Hope this helps?


On Mon, Jan 31, 2022 at 8:38 AM Wayne W  wrote:

> Hello all,
>
> Is anyone out there successfully using Selenium to do regression testing?
> It seems with the latest version of Selenium you cannot add custom
> selectors anymore (the idea turning on
> getDebugSettings().setComponentPathAttributeName("wicketpath") ). So it
> just uses css selectors and xpath now.
>
> Whilst I can had craft css selectors to use the wicketpath attribute I
> cannot get the IDE to use this by default. The problem is I want to hand
> this over to our QA person but she is not technical nature and would
> struggle to understand the correct selector when looking at the code and
> also it would really slow down the whole process of setting up tests.
>
> Anyone got Selenium working well, or can recommend another tool for web
> regressing testing that works well with Wicket?
>
> thanks
>


-- 
Regards - Ernesto Reinaldo Barreiro


Re: Selenium testing

2022-01-31 Thread Martin Terra
ma 31. tammik. 2022 klo 15.38 Wayne W (waynemailingli...@gmail.com)
kirjoitti:

> Hello all,
>
> Is anyone out there successfully using Selenium to do regression testing?
> It seems with the latest version of Selenium you cannot add custom
> selectors anymore (the idea turning on
> getDebugSettings().setComponentPathAttributeName("wicketpath") ). So it
> just uses css selectors and xpath now.
>
> Whilst I can had craft css selectors to use the wicketpath attribute I
> cannot get the IDE to use this by default. The problem is I want to hand
> this over to our QA person but she is not technical nature and would
> struggle to understand the correct selector when looking at the code and
> also it would really slow down the whole process of setting up tests.
>
> Anyone got Selenium working well, or can recommend another tool for web
> regressing testing that works well with Wicket?
>

We use WicketTester tests for regression tests and selenium tests for
availability tests.

Here's a hassle free guide to set up type safe testing without using string
property paths:

https://cwiki.apache.org/confluence/display/WICKET/Type-safe+testing+in+wicket

I'd say the overhead of selenium doesn't pay off using it for all tests,
but your mileage might vary.

**
Martin


> thanks
>


Selenium testing

2022-01-31 Thread Wayne W
Hello all,

Is anyone out there successfully using Selenium to do regression testing?
It seems with the latest version of Selenium you cannot add custom
selectors anymore (the idea turning on
getDebugSettings().setComponentPathAttributeName("wicketpath") ). So it
just uses css selectors and xpath now.

Whilst I can had craft css selectors to use the wicketpath attribute I
cannot get the IDE to use this by default. The problem is I want to hand
this over to our QA person but she is not technical nature and would
struggle to understand the correct selector when looking at the code and
also it would really slow down the whole process of setting up tests.

Anyone got Selenium working well, or can recommend another tool for web
regressing testing that works well with Wicket?

thanks


Re: Selenium Testing - Ajax Loads

2010-02-18 Thread Douglas Ferguson
I'm holding off for a bit. I want to make sure my approach is rock solid..

D/

On Feb 17, 2010, at 1:02 AM, Igor Vaynberg wrote:

> our wiki is here: http://cwiki.apache.org/WICKET register yourself an
> account and you should be good to go.
> 
> -igor
> 
> On Tue, Feb 16, 2010 at 9:43 PM, Douglas Ferguson
>  wrote:
>> Igor,
>> 
>> I have a decent solution and could put together a wiki page, just need to 
>> know where/how..
>> 
>> here's what I've got.
>> 
>> Click and Wait for wicket:
>> 
>>protected void clickAndWait(String wicketPath, long timeOut){
>>String callbackScript =
>>"if(!window.outstandingWicketCalls){" +
>>"  window.outstandingWicketCalls = 0;" +
>>"  var oldWicketGlobalPreCallHandler = 
>> window.wicketGlobalPreCallHandler;" +
>>"  var oldWicketGlobalPostCallHandler = 
>> window.wicketGlobalPostCallHandler;" +
>>"  window.wicketGlobalPreCallHandler = 
>> function() {" +
>>"   window.outstandingWicketCalls++; "+
>>"   oldWicketGlobalPreCallHandler();" +
>>"  };" +
>>" window.wicketGlobalPostCallHandler = function() 
>> {" +
>>"   oldWicketGlobalPostCallHandler();" +
>>"   window.outstandingWicketCalls--; "+
>>" };" +
>>"}" +
>>"window.write(window.outstandingWicketCalls);";
>> 
>>selenium.runScript(callbackScript);
>>click(wicketPath);
>>
>> selenium.waitForCondition("selenium.browserbot.getCurrentWindow();window.outstandingWicketCalls===0",
>>  Duration.seconds(8).getMilliseconds() +"");
>>}
>> 
>> 
>> Deal with unstable wicket paths
>> 
>>protected String getDOMLocator(String xpathTagName, String 
>> wicketPath, int index){
>> 
>>String regex = "_(\\d+|#)(_|$)";
>>Pattern repeaterWicketPathPatter = Pattern.compile(regex);
>>Matcher matcher = 
>> repeaterWicketPathPatter.matcher(wicketPath);
>> 
>>while(matcher.find()){
>>try{
>>if(index == -1){
>>index = 
>> Integer.parseInt(matcher.group(1));
>>}
>> 
>>String xpathRegex = "_[0-9]+";
>>if("_".equals(matcher.group(2))){
>>xpathRegex = xpathRegex + "_";
>>}
>>wicketPath = 
>> wicketPath.replace(matcher.group(), xpathRegex);
>>}catch(NumberFormatException nfe){
>>fail("index is required for getDOMLocator, 
>> please pass it to the method or as the first numeric value in the wicketpath 
>> provide i.e. foo_bar_134_child_#_child2_#");
>>}
>>}
>> 
>>StringWriter domLocator = new StringWriter();
>>domLocator.append("dom=");
>> 
>>if(index > 0){
>>domLocator.append("window.findElementByWicketPath('");
>>domLocator.append(wicketPath);
>>domLocator.append("', ");
>>domLocator.append(String.valueOf(index-1));
>>domLocator.append(");");
>>}else {
>>domLocator.append("window.$('[wicketpath=\\'");
>>        domLocator.append(wicketPath);
>>domLocator.append("\\']').get(0);");
>>}
>>return domLocator.toString();
>>}
>> 
>> 
>> Douglas Ferguson
>> 
>> mobile: 512.293.7279
>> office/fax: 512.462.0408
>> skype: stillrecording
>> aim:   

RE: Selenium Testing - Dealing with unstable wicket path

2010-02-16 Thread Douglas Ferguson
We have tons of unit tests and they are built in.
But for selenium this would not work, how can a web browser inspect your 
runtime object to determine correctness?

Douglas Ferguson

mobile: 512.293.7279
office/fax: 512.462.0408
skype: stillrecording
aim:   DaAmericanRuse

-

http://www.linkedin.com/in/douglasferguson
http://www.myspace.com/douglasferguson
http://www.douglasferguson.us/
http://www.distilleryrecords.com/
http://www.stillrecording.com/

Join my mailing list: distilleryrecords-subscr...@yahoogroups.com

From: Martin Makundi [martin.maku...@koodaripalvelut.com]
Sent: Wednesday, February 17, 2010 12:45 AM
To: users@wicket.apache.org
Subject: Re: Selenium Testing - Dealing with unstable wicket path

Hi!

Yes. We have found that building testability and acceptance tests into
the application is a good approach. Maybe it does not work for your
situation.

**
Martin

2010/2/17 Douglas Ferguson :
> yeah.. but if you are running functional tests against packaged software then 
> verifications will be happening outside of the applications's vm.
> the stuff you sent, depends on overloading application objects in order to 
> make hem testable in memory.
>
> Douglas Ferguson
>
> mobile: 512.293.7279
> office/fax: 512.462.0408
> skype: stillrecording
> aim:   DaAmericanRuse
>
> -
>
> http://www.linkedin.com/in/douglasferguson
> http://www.myspace.com/douglasferguson
> http://www.douglasferguson.us/
> http://www.distilleryrecords.com/
> http://www.stillrecording.com/
>
> Join my mailing list: distilleryrecords-subscr...@yahoogroups.com
> 
> From: Martin Makundi [martin.maku...@koodaripalvelut.com]
> Sent: Wednesday, February 17, 2010 12:11 AM
> To: users@wicket.apache.org
> Subject: Re: Selenium Testing - Dealing with unstable wicket path
>
> Hi!
>
> You can run selenium tests with junit.
>
> http://www.junit.org/node/23
>
> **
> Martin
>
> 2010/2/17 Douglas Ferguson :
>> Hmm.. How would the example you sent apply to selenium tests?
>>
>> That seems like a unit test approach.
>>
>> Douglas Ferguson
>>
>> mobile: 512.293.7279
>> office/fax: 512.462.0408
>> skype: stillrecording
>> aim:   DaAmericanRuse
>>
>> -
>>
>> http://www.linkedin.com/in/douglasferguson
>> http://www.myspace.com/douglasferguson
>> http://www.douglasferguson.us/
>> http://www.distilleryrecords.com/
>> http://www.stillrecording.com/
>>
>> Join my mailing list: distilleryrecords-subscr...@yahoogroups.com
>> 
>> From: Martin Makundi [martin.maku...@koodaripalvelut.com]
>> Sent: Tuesday, February 16, 2010 9:55 PM
>> To: users@wicket.apache.org
>> Subject: Re: Selenium Testing - Dealing with unstable wicket path
>>
>> Hi!
>>
>> Maybe you can generate the path from the actual path?
>>
>> http://cwiki.apache.org/WICKET/type-safe-testing-in-wicket.html
>>
>> **
>> Martin
>>
>> 2010/2/17 Douglas Ferguson :
>>> I'm using the following xpath wtih regex..
>>>
>>> and this works..
>>>
>>> "xpath=//*[fn:matches(@wicketpath,'taskListContainer_taskTable_taskList_\\d')][2]"
>>>
>>> but this doesn't
>>>
>>> "xpath=//*[fn:matches(@wicketpath,'taskListContainer_taskTable_taskList_\\d_taskContainer_edit')][2]"
>>>
>>> any idea why?
>>>
>>>
>>> -
>>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>>> For additional commands, e-mail: users-h...@wicket.apache.org
>>>
>>>
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>> For additional commands, e-mail: users-h...@wicket.apache.org
>>
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>> For additional commands, e-mail: users-h...@wicket.apache.org
>>
>>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org


-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Selenium Testing - Ajax Loads

2010-02-16 Thread Igor Vaynberg
our wiki is here: http://cwiki.apache.org/WICKET register yourself an
account and you should be good to go.

-igor

On Tue, Feb 16, 2010 at 9:43 PM, Douglas Ferguson
 wrote:
> Igor,
>
> I have a decent solution and could put together a wiki page, just need to 
> know where/how..
>
> here's what I've got.
>
> Click and Wait for wicket:
>
>        protected void clickAndWait(String wicketPath, long timeOut){
>                String callbackScript =
>                                "if(!window.outstandingWicketCalls){" +
>                                "  window.outstandingWicketCalls = 0;" +
>                                "  var oldWicketGlobalPreCallHandler = 
> window.wicketGlobalPreCallHandler;" +
>                                "  var oldWicketGlobalPostCallHandler = 
> window.wicketGlobalPostCallHandler;" +
>                                "  window.wicketGlobalPreCallHandler = 
> function() {" +
>                                "       window.outstandingWicketCalls++; "+
>                            "       oldWicketGlobalPreCallHandler();" +
>                            "  };" +
>                            " window.wicketGlobalPostCallHandler = function() 
> {" +
>                            "       oldWicketGlobalPostCallHandler();" +
>                            "       window.outstandingWicketCalls--; "+
>                            " };" +
>                            "}" +
>                            "window.write(window.outstandingWicketCalls);";
>
>                selenium.runScript(callbackScript);
>                click(wicketPath);
>                
> selenium.waitForCondition("selenium.browserbot.getCurrentWindow();window.outstandingWicketCalls===0",
>  Duration.seconds(8).getMilliseconds() +"");
>        }
>
>
> Deal with unstable wicket paths
>
>        protected String getDOMLocator(String xpathTagName, String wicketPath, 
> int index){
>
>                String regex = "_(\\d+|#)(_|$)";
>                Pattern repeaterWicketPathPatter = Pattern.compile(regex);
>                Matcher matcher = repeaterWicketPathPatter.matcher(wicketPath);
>
>                while(matcher.find()){
>                        try{
>                                if(index == -1){
>                                        index = 
> Integer.parseInt(matcher.group(1));
>                                }
>
>                                String xpathRegex = "_[0-9]+";
>                                if("_".equals(matcher.group(2))){
>                                        xpathRegex = xpathRegex + "_";
>                                }
>                                wicketPath = 
> wicketPath.replace(matcher.group(), xpathRegex);
>                        }catch(NumberFormatException nfe){
>                                fail("index is required for getDOMLocator, 
> please pass it to the method or as the first numeric value in the wicketpath 
> provide i.e. foo_bar_134_child_#_child2_#");
>                        }
>                }
>
>                StringWriter domLocator = new StringWriter();
>                domLocator.append("dom=");
>
>                if(index > 0){
>                        domLocator.append("window.findElementByWicketPath('");
>                        domLocator.append(wicketPath);
>                        domLocator.append("', ");
>                        domLocator.append(String.valueOf(index-1));
>                        domLocator.append(");");
>                }else {
>                        domLocator.append("window.$('[wicketpath=\\'");
>                        domLocator.append(wicketPath);
>                        domLocator.append("\\']').get(0);");
>                }
>                return domLocator.toString();
>        }
>
>
> Douglas Ferguson
>
> mobile: 512.293.7279
> office/fax: 512.462.0408
> skype: stillrecording
> aim:   DaAmericanRuse
>
> -
>
> http://www.linkedin.com/in/douglasferguson
> http://www.myspace.com/douglasferguson
> http://www.douglasferguson.us/
> http://www.distilleryrecords.com/
> http://www.stillrecording.com/
>
> Join my mailing list: distilleryrecords-subscr...@yahoogroups.com
> 
> From: Igor Vaynberg [igor.vaynb...@gmail.com]
> Sent: Tuesday, February 16, 2010 11:11 AM
> To: users@wicket.apache.org
> Subject: Re: Selenium Testing - Ajax Loads
>
> how would you do th

Re: Selenium Testing - Dealing with unstable wicket path

2010-02-16 Thread Martin Makundi
Hi!

Yes. We have found that building testability and acceptance tests into
the application is a good approach. Maybe it does not work for your
situation.

**
Martin

2010/2/17 Douglas Ferguson :
> yeah.. but if you are running functional tests against packaged software then 
> verifications will be happening outside of the applications's vm.
> the stuff you sent, depends on overloading application objects in order to 
> make hem testable in memory.
>
> Douglas Ferguson
>
> mobile: 512.293.7279
> office/fax: 512.462.0408
> skype: stillrecording
> aim:   DaAmericanRuse
>
> -
>
> http://www.linkedin.com/in/douglasferguson
> http://www.myspace.com/douglasferguson
> http://www.douglasferguson.us/
> http://www.distilleryrecords.com/
> http://www.stillrecording.com/
>
> Join my mailing list: distilleryrecords-subscr...@yahoogroups.com
> 
> From: Martin Makundi [martin.maku...@koodaripalvelut.com]
> Sent: Wednesday, February 17, 2010 12:11 AM
> To: users@wicket.apache.org
> Subject: Re: Selenium Testing - Dealing with unstable wicket path
>
> Hi!
>
> You can run selenium tests with junit.
>
> http://www.junit.org/node/23
>
> **
> Martin
>
> 2010/2/17 Douglas Ferguson :
>> Hmm.. How would the example you sent apply to selenium tests?
>>
>> That seems like a unit test approach.
>>
>> Douglas Ferguson
>>
>> mobile: 512.293.7279
>> office/fax: 512.462.0408
>> skype: stillrecording
>> aim:   DaAmericanRuse
>>
>> -
>>
>> http://www.linkedin.com/in/douglasferguson
>> http://www.myspace.com/douglasferguson
>> http://www.douglasferguson.us/
>> http://www.distilleryrecords.com/
>> http://www.stillrecording.com/
>>
>> Join my mailing list: distilleryrecords-subscr...@yahoogroups.com
>> 
>> From: Martin Makundi [martin.maku...@koodaripalvelut.com]
>> Sent: Tuesday, February 16, 2010 9:55 PM
>> To: users@wicket.apache.org
>> Subject: Re: Selenium Testing - Dealing with unstable wicket path
>>
>> Hi!
>>
>> Maybe you can generate the path from the actual path?
>>
>> http://cwiki.apache.org/WICKET/type-safe-testing-in-wicket.html
>>
>> **
>> Martin
>>
>> 2010/2/17 Douglas Ferguson :
>>> I'm using the following xpath wtih regex..
>>>
>>> and this works..
>>>
>>> "xpath=//*[fn:matches(@wicketpath,'taskListContainer_taskTable_taskList_\\d')][2]"
>>>
>>> but this doesn't
>>>
>>> "xpath=//*[fn:matches(@wicketpath,'taskListContainer_taskTable_taskList_\\d_taskContainer_edit')][2]"
>>>
>>> any idea why?
>>>
>>>
>>> -
>>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>>> For additional commands, e-mail: users-h...@wicket.apache.org
>>>
>>>
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>> For additional commands, e-mail: users-h...@wicket.apache.org
>>
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>> For additional commands, e-mail: users-h...@wicket.apache.org
>>
>>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



RE: Selenium Testing - Dealing with unstable wicket path

2010-02-16 Thread Douglas Ferguson
yeah.. but if you are running functional tests against packaged software then 
verifications will be happening outside of the applications's vm.
the stuff you sent, depends on overloading application objects in order to make 
hem testable in memory.

Douglas Ferguson

mobile: 512.293.7279
office/fax: 512.462.0408
skype: stillrecording
aim:   DaAmericanRuse

-

http://www.linkedin.com/in/douglasferguson
http://www.myspace.com/douglasferguson
http://www.douglasferguson.us/
http://www.distilleryrecords.com/
http://www.stillrecording.com/

Join my mailing list: distilleryrecords-subscr...@yahoogroups.com

From: Martin Makundi [martin.maku...@koodaripalvelut.com]
Sent: Wednesday, February 17, 2010 12:11 AM
To: users@wicket.apache.org
Subject: Re: Selenium Testing - Dealing with unstable wicket path

Hi!

You can run selenium tests with junit.

http://www.junit.org/node/23

**
Martin

2010/2/17 Douglas Ferguson :
> Hmm.. How would the example you sent apply to selenium tests?
>
> That seems like a unit test approach.
>
> Douglas Ferguson
>
> mobile: 512.293.7279
> office/fax: 512.462.0408
> skype: stillrecording
> aim:   DaAmericanRuse
>
> -
>
> http://www.linkedin.com/in/douglasferguson
> http://www.myspace.com/douglasferguson
> http://www.douglasferguson.us/
> http://www.distilleryrecords.com/
> http://www.stillrecording.com/
>
> Join my mailing list: distilleryrecords-subscr...@yahoogroups.com
> 
> From: Martin Makundi [martin.maku...@koodaripalvelut.com]
> Sent: Tuesday, February 16, 2010 9:55 PM
> To: users@wicket.apache.org
> Subject: Re: Selenium Testing - Dealing with unstable wicket path
>
> Hi!
>
> Maybe you can generate the path from the actual path?
>
> http://cwiki.apache.org/WICKET/type-safe-testing-in-wicket.html
>
> **
> Martin
>
> 2010/2/17 Douglas Ferguson :
>> I'm using the following xpath wtih regex..
>>
>> and this works..
>>
>> "xpath=//*[fn:matches(@wicketpath,'taskListContainer_taskTable_taskList_\\d')][2]"
>>
>> but this doesn't
>>
>> "xpath=//*[fn:matches(@wicketpath,'taskListContainer_taskTable_taskList_\\d_taskContainer_edit')][2]"
>>
>> any idea why?
>>
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>> For additional commands, e-mail: users-h...@wicket.apache.org
>>
>>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org


-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Selenium Testing - Dealing with unstable wicket path

2010-02-16 Thread Martin Makundi
More:

http://www.junit.org/node/23

2010/2/17 Martin Makundi :
> Hi!
>
> You can run selenium tests with junit.
>
> http://www.junit.org/node/23
>
> **
> Martin
>
> 2010/2/17 Douglas Ferguson :
>> Hmm.. How would the example you sent apply to selenium tests?
>>
>> That seems like a unit test approach.
>>
>> Douglas Ferguson
>>
>> mobile: 512.293.7279
>> office/fax: 512.462.0408
>> skype: stillrecording
>> aim:   DaAmericanRuse
>>
>> -
>>
>> http://www.linkedin.com/in/douglasferguson
>> http://www.myspace.com/douglasferguson
>> http://www.douglasferguson.us/
>> http://www.distilleryrecords.com/
>> http://www.stillrecording.com/
>>
>> Join my mailing list: distilleryrecords-subscr...@yahoogroups.com
>> ____
>> From: Martin Makundi [martin.maku...@koodaripalvelut.com]
>> Sent: Tuesday, February 16, 2010 9:55 PM
>> To: users@wicket.apache.org
>> Subject: Re: Selenium Testing - Dealing with unstable wicket path
>>
>> Hi!
>>
>> Maybe you can generate the path from the actual path?
>>
>> http://cwiki.apache.org/WICKET/type-safe-testing-in-wicket.html
>>
>> **
>> Martin
>>
>> 2010/2/17 Douglas Ferguson :
>>> I'm using the following xpath wtih regex..
>>>
>>> and this works..
>>>
>>> "xpath=//*[fn:matches(@wicketpath,'taskListContainer_taskTable_taskList_\\d')][2]"
>>>
>>> but this doesn't
>>>
>>> "xpath=//*[fn:matches(@wicketpath,'taskListContainer_taskTable_taskList_\\d_taskContainer_edit')][2]"
>>>
>>> any idea why?
>>>
>>>
>>> -
>>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>>> For additional commands, e-mail: users-h...@wicket.apache.org
>>>
>>>
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>> For additional commands, e-mail: users-h...@wicket.apache.org
>>
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>> For additional commands, e-mail: users-h...@wicket.apache.org
>>
>>
>

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Selenium Testing - Dealing with unstable wicket path

2010-02-16 Thread Martin Makundi
Hi!

You can run selenium tests with junit.

http://www.junit.org/node/23

**
Martin

2010/2/17 Douglas Ferguson :
> Hmm.. How would the example you sent apply to selenium tests?
>
> That seems like a unit test approach.
>
> Douglas Ferguson
>
> mobile: 512.293.7279
> office/fax: 512.462.0408
> skype: stillrecording
> aim:   DaAmericanRuse
>
> -
>
> http://www.linkedin.com/in/douglasferguson
> http://www.myspace.com/douglasferguson
> http://www.douglasferguson.us/
> http://www.distilleryrecords.com/
> http://www.stillrecording.com/
>
> Join my mailing list: distilleryrecords-subscr...@yahoogroups.com
> 
> From: Martin Makundi [martin.maku...@koodaripalvelut.com]
> Sent: Tuesday, February 16, 2010 9:55 PM
> To: users@wicket.apache.org
> Subject: Re: Selenium Testing - Dealing with unstable wicket path
>
> Hi!
>
> Maybe you can generate the path from the actual path?
>
> http://cwiki.apache.org/WICKET/type-safe-testing-in-wicket.html
>
> **
> Martin
>
> 2010/2/17 Douglas Ferguson :
>> I'm using the following xpath wtih regex..
>>
>> and this works..
>>
>> "xpath=//*[fn:matches(@wicketpath,'taskListContainer_taskTable_taskList_\\d')][2]"
>>
>> but this doesn't
>>
>> "xpath=//*[fn:matches(@wicketpath,'taskListContainer_taskTable_taskList_\\d_taskContainer_edit')][2]"
>>
>> any idea why?
>>
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>> For additional commands, e-mail: users-h...@wicket.apache.org
>>
>>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



RE: Selenium Testing - Ajax Loads

2010-02-16 Thread Douglas Ferguson
Igor,

I have a decent solution and could put together a wiki page, just need to know 
where/how..

here's what I've got.

Click and Wait for wicket:

protected void clickAndWait(String wicketPath, long timeOut){
String callbackScript = 
"if(!window.outstandingWicketCalls){" +
"  window.outstandingWicketCalls = 0;" +
"  var oldWicketGlobalPreCallHandler = 
window.wicketGlobalPreCallHandler;" +
"  var oldWicketGlobalPostCallHandler = 
window.wicketGlobalPostCallHandler;" +
"  window.wicketGlobalPreCallHandler = 
function() {" +
"   window.outstandingWicketCalls++; "+
"   oldWicketGlobalPreCallHandler();" +
"  };" +
" window.wicketGlobalPostCallHandler = function() 
{" +
"   oldWicketGlobalPostCallHandler();" +
"   window.outstandingWicketCalls--; "+
" };" +
"}" +
"window.write(window.outstandingWicketCalls);";

selenium.runScript(callbackScript);
click(wicketPath);

selenium.waitForCondition("selenium.browserbot.getCurrentWindow();window.outstandingWicketCalls===0",
 Duration.seconds(8).getMilliseconds() +"");
}


Deal with unstable wicket paths

protected String getDOMLocator(String xpathTagName, String wicketPath, 
int index){

String regex = "_(\\d+|#)(_|$)";
Pattern repeaterWicketPathPatter = Pattern.compile(regex);
Matcher matcher = repeaterWicketPathPatter.matcher(wicketPath);

while(matcher.find()){
try{
if(index == -1){
index = 
Integer.parseInt(matcher.group(1));
}

String xpathRegex = "_[0-9]+";
if("_".equals(matcher.group(2))){
xpathRegex = xpathRegex + "_";
}
wicketPath = 
wicketPath.replace(matcher.group(), xpathRegex);
}catch(NumberFormatException nfe){
fail("index is required for getDOMLocator, 
please pass it to the method or as the first numeric value in the wicketpath 
provide i.e. foo_bar_134_child_#_child2_#");
}
}

StringWriter domLocator = new StringWriter();
domLocator.append("dom=");

if(index > 0){
domLocator.append("window.findElementByWicketPath('");
domLocator.append(wicketPath);
domLocator.append("', ");
domLocator.append(String.valueOf(index-1));
domLocator.append(");");
}else {
domLocator.append("window.$('[wicketpath=\\'");
domLocator.append(wicketPath);
domLocator.append("\\']').get(0);");
}
return domLocator.toString();
}


Douglas Ferguson

mobile: 512.293.7279
office/fax: 512.462.0408
skype: stillrecording
aim:   DaAmericanRuse

-

http://www.linkedin.com/in/douglasferguson
http://www.myspace.com/douglasferguson
http://www.douglasferguson.us/
http://www.distilleryrecords.com/
http://www.stillrecording.com/

Join my mailing list: distilleryrecords-subscr...@yahoogroups.com

From: Igor Vaynberg [igor.vaynb...@gmail.com]
Sent: Tuesday, February 16, 2010 11:11 AM
To: users@wicket.apache.org
Subject: Re: Selenium Testing - Ajax Loads

how would you do that exactly?

-igor

On Tue, Feb 16, 2010 at 7:26 AM, Douglas Ferguson
 wrote:
>
>> the path in repeaters is never stable, it depends on a lot of factors
>> and is hard to predict. i think what may be a good way to deal with it
>> is to use an IComponentInstantiationListener to add a behavior to Item
>> subclasses to output their index in some attribute. install this
>> listener only during test time or simply make it output nothing if not
>> during the test.
>>
>
> Interesting I'll look into 

RE: Selenium Testing - Dealing with unstable wicket path

2010-02-16 Thread Douglas Ferguson
Hmm.. How would the example you sent apply to selenium tests?
 
That seems like a unit test approach.

Douglas Ferguson

mobile: 512.293.7279
office/fax: 512.462.0408
skype: stillrecording
aim:   DaAmericanRuse

-

http://www.linkedin.com/in/douglasferguson
http://www.myspace.com/douglasferguson
http://www.douglasferguson.us/
http://www.distilleryrecords.com/
http://www.stillrecording.com/

Join my mailing list: distilleryrecords-subscr...@yahoogroups.com

From: Martin Makundi [martin.maku...@koodaripalvelut.com]
Sent: Tuesday, February 16, 2010 9:55 PM
To: users@wicket.apache.org
Subject: Re: Selenium Testing - Dealing with unstable wicket path

Hi!

Maybe you can generate the path from the actual path?

http://cwiki.apache.org/WICKET/type-safe-testing-in-wicket.html

**
Martin

2010/2/17 Douglas Ferguson :
> I'm using the following xpath wtih regex..
>
> and this works..
>
> "xpath=//*[fn:matches(@wicketpath,'taskListContainer_taskTable_taskList_\\d')][2]"
>
> but this doesn't
>
> "xpath=//*[fn:matches(@wicketpath,'taskListContainer_taskTable_taskList_\\d_taskContainer_edit')][2]"
>
> any idea why?
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org


-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Selenium Testing - Dealing with unstable wicket path

2010-02-16 Thread Martin Makundi
Hi!

Maybe you can generate the path from the actual path?

http://cwiki.apache.org/WICKET/type-safe-testing-in-wicket.html

**
Martin

2010/2/17 Douglas Ferguson :
> I'm using the following xpath wtih regex..
>
> and this works..
>
> "xpath=//*[fn:matches(@wicketpath,'taskListContainer_taskTable_taskList_\\d')][2]"
>
> but this doesn't
>
> "xpath=//*[fn:matches(@wicketpath,'taskListContainer_taskTable_taskList_\\d_taskContainer_edit')][2]"
>
> any idea why?
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Selenium Testing - Dealing with unstable wicket path

2010-02-16 Thread Douglas Ferguson
I'm using the following xpath wtih regex..

and this works..

"xpath=//*[fn:matches(@wicketpath,'taskListContainer_taskTable_taskList_\\d')][2]"

but this doesn't

"xpath=//*[fn:matches(@wicketpath,'taskListContainer_taskTable_taskList_\\d_taskContainer_edit')][2]"

any idea why?


-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



RE: Selenium Testing - Ajax Loads

2010-02-16 Thread Douglas Ferguson
Not sure.. but I'm just curious how this attribute can be stable but the path 
can't, since it is an attribute also.
Perhaps the path could just have ${index} it, then this behavior would replace 
that with the actual index.


Douglas Ferguson

mobile: 512.293.7279
office/fax: 512.462.0408
skype: stillrecording
aim:   DaAmericanRuse

-

http://www.linkedin.com/in/douglasferguson
http://www.myspace.com/douglasferguson
http://www.douglasferguson.us/
http://www.distilleryrecords.com/
http://www.stillrecording.com/

Join my mailing list: distilleryrecords-subscr...@yahoogroups.com

From: Igor Vaynberg [igor.vaynb...@gmail.com]
Sent: Tuesday, February 16, 2010 11:11 AM
To: users@wicket.apache.org
Subject: Re: Selenium Testing - Ajax Loads

how would you do that exactly?

-igor

On Tue, Feb 16, 2010 at 7:26 AM, Douglas Ferguson
 wrote:
>
>> the path in repeaters is never stable, it depends on a lot of factors
>> and is hard to predict. i think what may be a good way to deal with it
>> is to use an IComponentInstantiationListener to add a behavior to Item
>> subclasses to output their index in some attribute. install this
>> listener only during test time or simply make it output nothing if not
>> during the test.
>>
>
> Interesting I'll look into it..
> Is there really any reason why not to just always have the listener there.
> Seems like there would be little overhead in doing this...
>
> But I am curious, if this can be done then why couldn't the wicket page also 
> be made stable using the same technique?
>
>>>>> 2) I have issues with timing which is typical, and most people call 
>>>>> "waitForPageToLoad" which works fine for normal http requests, but if It 
>>>>> is an ajax request I'm waiting for, then I have to implement a 
>>>>> waitForContition. Is there a wicket convention I could use here? i.e. how 
>>>>> can I know that a wicket ajax call has completed?
>>>>
>>>> there are global ajax callbacks that are invoked when an ajax request
>>>> completes. you can search this list for what they are. i imagine you
>>>> can write a bit of javascript to hook into those and implement
>>>> waitForCondition.
>>>
>>> I'm actually using the window.wicketGlobalPreCallHandler and 
>>> window.wicketGlobalPostCallHandler in my code already.
>>> Do you think it would be safe to use those? I.E. preHander sets a boolean 
>>> "isWaitingOnAjax" and postHander unsets it?
>>>
>>> Then I can do a waitForConition(!isWaitingOnAjax)
>>
>> yeah, that sounds like a good starting point.
>>
>> -igor
>>
>>>
>>>>
>>>> when you get all this working maybe you can create a wiki page about
>>>> it to help users who will have the same questions in the future.
>>>
>>> Sounds good...
>>>
>>>>
>>>> -igor
>>>>
>>>>
>>>>>
>>>>> Thanks,
>>>>>
>>>>> D/
>>>>> -
>>>>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>>>>> For additional commands, e-mail: users-h...@wicket.apache.org
>>>>>
>>>>>
>>>>
>>>> -
>>>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>>>> For additional commands, e-mail: users-h...@wicket.apache.org
>>>>
>>>
>>>
>>> -
>>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>>> For additional commands, e-mail: users-h...@wicket.apache.org
>>>
>>>
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>> For additional commands, e-mail: users-h...@wicket.apache.org
>>
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org


-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Selenium Testing - Ajax Loads

2010-02-16 Thread Igor Vaynberg
how would you do that exactly?

-igor

On Tue, Feb 16, 2010 at 7:26 AM, Douglas Ferguson
 wrote:
>
>> the path in repeaters is never stable, it depends on a lot of factors
>> and is hard to predict. i think what may be a good way to deal with it
>> is to use an IComponentInstantiationListener to add a behavior to Item
>> subclasses to output their index in some attribute. install this
>> listener only during test time or simply make it output nothing if not
>> during the test.
>>
>
> Interesting I'll look into it..
> Is there really any reason why not to just always have the listener there.
> Seems like there would be little overhead in doing this...
>
> But I am curious, if this can be done then why couldn't the wicket page also 
> be made stable using the same technique?
>
> 2) I have issues with timing which is typical, and most people call 
> "waitForPageToLoad" which works fine for normal http requests, but if It 
> is an ajax request I'm waiting for, then I have to implement a 
> waitForContition. Is there a wicket convention I could use here? i.e. how 
> can I know that a wicket ajax call has completed?

 there are global ajax callbacks that are invoked when an ajax request
 completes. you can search this list for what they are. i imagine you
 can write a bit of javascript to hook into those and implement
 waitForCondition.
>>>
>>> I'm actually using the window.wicketGlobalPreCallHandler and 
>>> window.wicketGlobalPostCallHandler in my code already.
>>> Do you think it would be safe to use those? I.E. preHander sets a boolean 
>>> "isWaitingOnAjax" and postHander unsets it?
>>>
>>> Then I can do a waitForConition(!isWaitingOnAjax)
>>
>> yeah, that sounds like a good starting point.
>>
>> -igor
>>
>>>

 when you get all this working maybe you can create a wiki page about
 it to help users who will have the same questions in the future.
>>>
>>> Sounds good...
>>>

 -igor


>
> Thanks,
>
> D/
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>

 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org

>>>
>>>
>>> -
>>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>>> For additional commands, e-mail: users-h...@wicket.apache.org
>>>
>>>
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>> For additional commands, e-mail: users-h...@wicket.apache.org
>>
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Selenium Testing - Ajax Loads

2010-02-16 Thread Douglas Ferguson

> the path in repeaters is never stable, it depends on a lot of factors
> and is hard to predict. i think what may be a good way to deal with it
> is to use an IComponentInstantiationListener to add a behavior to Item
> subclasses to output their index in some attribute. install this
> listener only during test time or simply make it output nothing if not
> during the test.
> 

Interesting I'll look into it..
Is there really any reason why not to just always have the listener there. 
Seems like there would be little overhead in doing this...

But I am curious, if this can be done then why couldn't the wicket page also be 
made stable using the same technique?

 2) I have issues with timing which is typical, and most people call 
 "waitForPageToLoad" which works fine for normal http requests, but if It 
 is an ajax request I'm waiting for, then I have to implement a 
 waitForContition. Is there a wicket convention I could use here? i.e. how 
 can I know that a wicket ajax call has completed?
>>> 
>>> there are global ajax callbacks that are invoked when an ajax request
>>> completes. you can search this list for what they are. i imagine you
>>> can write a bit of javascript to hook into those and implement
>>> waitForCondition.
>> 
>> I'm actually using the window.wicketGlobalPreCallHandler and 
>> window.wicketGlobalPostCallHandler in my code already.
>> Do you think it would be safe to use those? I.E. preHander sets a boolean 
>> "isWaitingOnAjax" and postHander unsets it?
>> 
>> Then I can do a waitForConition(!isWaitingOnAjax)
> 
> yeah, that sounds like a good starting point.
> 
> -igor
> 
>> 
>>> 
>>> when you get all this working maybe you can create a wiki page about
>>> it to help users who will have the same questions in the future.
>> 
>> Sounds good...
>> 
>>> 
>>> -igor
>>> 
>>> 
 
 Thanks,
 
 D/
 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org
 
 
>>> 
>>> -
>>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>>> For additional commands, e-mail: users-h...@wicket.apache.org
>>> 
>> 
>> 
>> -
>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>> For additional commands, e-mail: users-h...@wicket.apache.org
>> 
>> 
> 
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
> 


-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Selenium Testing - Ajax Loads

2010-02-15 Thread Igor Vaynberg
On Mon, Feb 15, 2010 at 11:14 PM, Douglas Ferguson
 wrote:
>
> On Feb 16, 2010, at 12:34 AM, Igor Vaynberg wrote:
>
>> On Mon, Feb 15, 2010 at 8:08 PM, Douglas Ferguson
>>  wrote:
>>> Hey,
>>>
>>> I'm starting to write selenium tests for my wicket app and am running into 
>>> issues with a couple of wicket related problems that I thought perhaps 
>>> somebody else may have solved.
>>>
>>> 1) Sometimes my repeaters don't print out consistent wicket paths, i.e. 
>>> sometimes it may go  element_path_name_1 to  element_path_name_4 if I have 
>>> 4 elements.. Other times it might be  element_path_name_4 to  
>>> element_path_name_7 after some ajax calls, I'm not sure when/why this 
>>> happens. Need to play with it more.
>>
>> there is an option to output wicket:path attribute for tags. this attr
>> will contain page-relative path of the component which should be more
>> stable then the id. if you want to have stable ids then you should
>> manage them yourself using setmarkupid()
>
> I am using the wicket path already. The problem is that the wicket path seems 
> to change.. The examples above I'm referring to the wicket path of my 
> repeater.
> It seems to normally give the elements a number from 1 - n, tacked onto the 
> wicket path of the root component of the repeater.
> Sometimes after some ajax calls, it seems to renumber them.. i.e. instead of 
> 1-4 it becomes 4-7 or something...

the path in repeaters is never stable, it depends on a lot of factors
and is hard to predict. i think what may be a good way to deal with it
is to use an IComponentInstantiationListener to add a behavior to Item
subclasses to output their index in some attribute. install this
listener only during test time or simply make it output nothing if not
during the test.

>>> 2) I have issues with timing which is typical, and most people call 
>>> "waitForPageToLoad" which works fine for normal http requests, but if It is 
>>> an ajax request I'm waiting for, then I have to implement a 
>>> waitForContition. Is there a wicket convention I could use here? i.e. how 
>>> can I know that a wicket ajax call has completed?
>>
>> there are global ajax callbacks that are invoked when an ajax request
>> completes. you can search this list for what they are. i imagine you
>> can write a bit of javascript to hook into those and implement
>> waitForCondition.
>
> I'm actually using the window.wicketGlobalPreCallHandler and 
> window.wicketGlobalPostCallHandler in my code already.
> Do you think it would be safe to use those? I.E. preHander sets a boolean 
> "isWaitingOnAjax" and postHander unsets it?
>
> Then I can do a waitForConition(!isWaitingOnAjax)

yeah, that sounds like a good starting point.

-igor

>
>>
>> when you get all this working maybe you can create a wiki page about
>> it to help users who will have the same questions in the future.
>
> Sounds good...
>
>>
>> -igor
>>
>>
>>>
>>> Thanks,
>>>
>>> D/
>>> -
>>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>>> For additional commands, e-mail: users-h...@wicket.apache.org
>>>
>>>
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>> For additional commands, e-mail: users-h...@wicket.apache.org
>>
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Selenium Testing - Ajax Loads

2010-02-15 Thread Douglas Ferguson

On Feb 16, 2010, at 12:34 AM, Igor Vaynberg wrote:

> On Mon, Feb 15, 2010 at 8:08 PM, Douglas Ferguson
>  wrote:
>> Hey,
>> 
>> I'm starting to write selenium tests for my wicket app and am running into 
>> issues with a couple of wicket related problems that I thought perhaps 
>> somebody else may have solved.
>> 
>> 1) Sometimes my repeaters don't print out consistent wicket paths, i.e. 
>> sometimes it may go  element_path_name_1 to  element_path_name_4 if I have 4 
>> elements.. Other times it might be  element_path_name_4 to  
>> element_path_name_7 after some ajax calls, I'm not sure when/why this 
>> happens. Need to play with it more.
> 
> there is an option to output wicket:path attribute for tags. this attr
> will contain page-relative path of the component which should be more
> stable then the id. if you want to have stable ids then you should
> manage them yourself using setmarkupid()

I am using the wicket path already. The problem is that the wicket path seems 
to change.. The examples above I'm referring to the wicket path of my repeater.
It seems to normally give the elements a number from 1 - n, tacked onto the 
wicket path of the root component of the repeater.
Sometimes after some ajax calls, it seems to renumber them.. i.e. instead of 
1-4 it becomes 4-7 or something...

> 
>> 2) I have issues with timing which is typical, and most people call 
>> "waitForPageToLoad" which works fine for normal http requests, but if It is 
>> an ajax request I'm waiting for, then I have to implement a 
>> waitForContition. Is there a wicket convention I could use here? i.e. how 
>> can I know that a wicket ajax call has completed?
> 
> there are global ajax callbacks that are invoked when an ajax request
> completes. you can search this list for what they are. i imagine you
> can write a bit of javascript to hook into those and implement
> waitForCondition.

I'm actually using the window.wicketGlobalPreCallHandler and 
window.wicketGlobalPostCallHandler in my code already.
Do you think it would be safe to use those? I.E. preHander sets a boolean 
"isWaitingOnAjax" and postHander unsets it?

Then I can do a waitForConition(!isWaitingOnAjax)

> 
> when you get all this working maybe you can create a wiki page about
> it to help users who will have the same questions in the future.

Sounds good...

> 
> -igor
> 
> 
>> 
>> Thanks,
>> 
>> D/
>> -
>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>> For additional commands, e-mail: users-h...@wicket.apache.org
>> 
>> 
> 
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
> 


-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Selenium Testing - Ajax Loads

2010-02-15 Thread Igor Vaynberg
On Mon, Feb 15, 2010 at 8:08 PM, Douglas Ferguson
 wrote:
> Hey,
>
> I'm starting to write selenium tests for my wicket app and am running into 
> issues with a couple of wicket related problems that I thought perhaps 
> somebody else may have solved.
>
> 1) Sometimes my repeaters don't print out consistent wicket paths, i.e. 
> sometimes it may go  element_path_name_1 to  element_path_name_4 if I have 4 
> elements.. Other times it might be  element_path_name_4 to  
> element_path_name_7 after some ajax calls, I'm not sure when/why this 
> happens. Need to play with it more.

there is an option to output wicket:path attribute for tags. this attr
will contain page-relative path of the component which should be more
stable then the id. if you want to have stable ids then you should
manage them yourself using setmarkupid()

> 2) I have issues with timing which is typical, and most people call 
> "waitForPageToLoad" which works fine for normal http requests, but if It is 
> an ajax request I'm waiting for, then I have to implement a waitForContition. 
> Is there a wicket convention I could use here? i.e. how can I know that a 
> wicket ajax call has completed?

there are global ajax callbacks that are invoked when an ajax request
completes. you can search this list for what they are. i imagine you
can write a bit of javascript to hook into those and implement
waitForCondition.

when you get all this working maybe you can create a wiki page about
it to help users who will have the same questions in the future.

-igor


>
> Thanks,
>
> D/
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Selenium Testing - Ajax Loads

2010-02-15 Thread Douglas Ferguson
Hey,

I'm starting to write selenium tests for my wicket app and am running into 
issues with a couple of wicket related problems that I thought perhaps somebody 
else may have solved.

1) Sometimes my repeaters don't print out consistent wicket paths, i.e. 
sometimes it may go  element_path_name_1 to  element_path_name_4 if I have 4 
elements.. Other times it might be  element_path_name_4 to  element_path_name_7 
after some ajax calls, I'm not sure when/why this happens. Need to play with it 
more. 

2) I have issues with timing which is typical, and most people call 
"waitForPageToLoad" which works fine for normal http requests, but if It is an 
ajax request I'm waiting for, then I have to implement a waitForContition. Is 
there a wicket convention I could use here? i.e. how can I know that a wicket 
ajax call has completed?

Thanks,

D/
-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org