0

im trying to click on this link:

<a id="table_statementlist_get_ib_table:0:ordernumber" class="OraLink" href="#" onclick="return _chain('disable_load_window();','submitForm(\'ib_trn_base_pas_statementlist_get\',0,{source:\'table_statementlist_get_ib_table:0:ordernumber\'});return false;',this,event,true)" name="table_statementlist_get_ib_table:0:ordernumber"> 6 </a>

and save some file that is returned to the browser. I have added WebWindowListener with implemented webWindowContentChanged method to my WebClient, which looks like this:

@Override
public void webWindowContentChanged(WebWindowEvent webWindowEvent) {
    WebResponse response = webWindowEvent.getWebWindow().getEnclosedPage().getWebResponse();

I have found that anchor by xpath, but when i want to fire click() method on it, webWindowContentChanged is not triggered. Other links works just fine. Timeout for javascript is decent i guess:

webClient.waitForBackgroundJavaScript(30000);

Any suggestions how to get that file? Thanks in advance.

Martin
  • 55
  • 1
  • 6

1 Answers1

0

I figured it out.

webClient.waitForBackgroundJavaScript(10000);

should be called after click(). I thought it was a property for the case some javascript would appear

Martin
  • 55
  • 1
  • 6