Re: RequestLogger - Different Page Memory Addresses

2022-01-31 Thread Sven Meier

Hi,

session size is calculated by serializing the session.

During session serializing your cached page is thrown away, see 
InSessionPageStore#writeObject().
So the next request will acquire the page from the persistent store: 
it's the identical page, just on a different memory location.


This is expected when sessions are serialized/deserialized - usually 
when the container decides to do so.

In your case it's a side effect of the request logger doing it.

Have fun
Sven


On 31.01.22 19:41, Drummer, Matthias wrote:


Hello all,

I stumbled across the following issue.

If the RequestLogger is activated, I get a new page object with every 
request (including AjaxRequests). If disabled then the page object 
will remain the same across multiple requests.


I am wondering why this is the case.

I attached a quickstart for reproducing the problem and made an 
ExamplePage (http://localhost:8080/example) which logs the Memory 
Address of the Page.


In my expectation the RequestLogger should log the request and 
additional informations but should not change the behavior of the 
application. It still works, but something is different which caughts 
my interest.


The behavior is as expected if I set the recordSessionSize property to 
false.


getRequestLoggerSettings().setRequestLoggerEnabled(true).setRecordSessionSize(false);

This setting affects the processing of 
org.apache.wicket.protocol.http.AbstractRequestLogger#requestTime 
where 
Application.get().getRequestLoggerSettings().getRecordSessionSize() is 
evaluated, but I have no idea why this leads to new objects.


Perhaps someone has an idea why this happens and which setting has to 
be made to get the expected behavior.


Thanks.

Greetings Matthias Drummer


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

RequestLogger - Different Page Memory Addresses

2022-01-31 Thread Drummer, Matthias
Hello all,

I stumbled across the following issue.

If the RequestLogger is activated, I get a new page object with every request 
(including AjaxRequests). If disabled then the page object will remain the same 
across multiple requests.
I am wondering why this is the case.

I attached a quickstart for reproducing the problem and made an ExamplePage 
(http://localhost:8080/example) which logs the Memory Address of the Page.
In my expectation the RequestLogger should log the request and additional 
informations but should not change the behavior of the application. It still 
works, but something is different which caughts my interest.
The behavior is as expected if I set the recordSessionSize property to false.

getRequestLoggerSettings().setRequestLoggerEnabled(true).setRecordSessionSize(false);

This setting affects the processing of 
org.apache.wicket.protocol.http.AbstractRequestLogger#requestTime where 
Application.get().getRequestLoggerSettings().getRecordSessionSize() is 
evaluated, but I have no idea why this leads to new objects.
Perhaps someone has an idea why this happens and which setting has to be made 
to get the expected behavior.

Thanks.

Greetings Matthias Drummer
<>

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

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


How to use the JavaScriptDeferHeaderResponse correctly?

2022-01-31 Thread Bas Gooren
Hi,

We are experimenting with the JavaScriptDeferHeaderResponse, but out of the
box it doesn’t work correctly for us.
We are on wicket 9.7.0.

On an Ajax call (e.g. link click), the response includes a
‘DOMContentLoaded’ event listener (which is not needed there). Since that
never fires, any javascript handlers that are in the Ajax response are not
registered.
Please have a look at the attached Quickstart, which demonstrates the issue.

Once the AJAX link is clicked, this evaluate node is added to the Ajax
response (relevant part shown):

document.addEventListener('DOMContentLoaded', function() {
(function(){console.log('test');})();(function(){Wicket.Log.enabled=true;})();(function(){Wicket.Ajax.baseUrl="?0";})();(function(){Wicket.Ajax.ajax({"u":"./?0-1.0-ajax","c":"ajax1","e":"click","pd":true});})();(function(){console.log('click');})();;
});

The Ajax handler (Wicket.Ajax.ajax()) is inside the DOMContentLoaded event
handler.

I’m not sure if we should be using the JavaScriptDeferHeaderResponse
differently. We tried registering it using the three different methods
provided by the header response decorators collection (add, add pre, add
post).

Any help would be appreciated :-)

Met vriendelijke groet,
Kind regards,

Bas Gooren

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

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