JBoss Community Archive (Read Only)

Graphene 2

guardAjax(input).sendKeys("abc");

Issue:

  • the guard does not work correctly - i.e.

    • it timeouts

    • or it ends prematurely (when page is partially updated)

Analysis:

  • sendKeys behaves as you would expect from a real user interaction - several characters are typed sequentially, which is accompanied by appropriate number of keydown/keypress/keyup events and it does not fire any blur event

  • guard actually wraps exactly one XHR request, which is triggered by appropriate user interaction

Solution:

  • if your application triggers AJAX request when blur happens, then you need to guard blur event (either click to another input or to body element):

    • input.sendKeys("abc"); guardAjax(body).click();

  • if your application triggers AJAX request when keydown/keyup happens, then you need to wait for a last update: 

    • input.sendKeys("ab"); guardAjax(input).sendKeys("c");

JBoss.org Content Archive (Read Only), exported from JBoss Community Documentation Editor at 2020-03-10 12:14:40 UTC, last content change 2013-05-28 13:59:11 UTC.