Menu

Running onclick code

Help
Anonymous
2004-05-14
2013-04-26
  • Anonymous

    Anonymous - 2004-05-14

    I have HTML code which contains the following fragment:

    <TD ID='resultTab_c'
    ONCLICK="tabsheetAction('select','resultTab','detailTabsheet','selectedTabPanel');"

    Is there a way which I can get the onclick javascript to execute? "response.getLinkWith("resultTab_c").click()" doesn't work

    /Jacob

     
    • Papick Garcia Taboada

      Hi,

      I do have a similar problem: my onClick event is bound to a div.

      I tried something like this:

      ---- 8< ----
              WebResponse wr = this.getDialog().getResponse();
              HTMLElement element = wr.getElementWithID("btnApprove");
              ScriptableDelegate delegate = element.getScriptableDelegate();
              String event = element.getAttribute("onclick");
              if (event.length() > 0) {
                  boolean b = delegate.doEvent(event);
                  assertTrue("onClick event", b);
              }
      ---- 8< ----

      the last assertion is failing and the event is not executed.

      Maybe someone could help on this one? I would like to have some like:

      response = wr.getElementByIdAndThrowEvent("onclick", "myElementId");

      brgds,

      Papick

       

Log in to post a comment.

MongoDB Logo MongoDB