Jump to content

FF.au3 and Button with 'onclick' event


Recommended Posts

Hi!

I have the following button I would like to 'click' on:


 

<span class="searchButton" id="searchButton" name="searchButton"> <input name="" src="http://proxylibrary.hse.ru:2083/WOKRS522_1R3/images/search.gif" onclick="return JQcheck_form_inputs('WOS_AdvancedSearch_input_form');" title="Search" alt="Search" align="absmiddle" border="0" type="image"> </span> <span class="searchRunning" id="searchRunning" name="searchRunning" style="display: none;">  <img src="http://proxylibrary.hse.ru:2083/WOKRS522_1R3/images/search_disabled.gif" alt="Search in process" title="Search in process" align="absmiddle" border="0">  </span> 

 

I have tried the following in different variants:


[autoit]_FFClick("AdvSearchButton", "id")[/autoit]

   _FFXPath( "//span[@id='searchButton']")
        _FFCmd("FFau3.xpath.onclick()"[/autoit]

[code]_FFCmd('.getElementById("searchButton").onClick();')[/autoit]

[code]_FFImageClick("http://proxylibrary.hse.ru:2083/WOKRS522_1R3/images/search.gif")[/autoit]

Nothing helps so far. 

Please, help!

 

Link to comment
Share on other sites

11 hours ago, Danp2 said:

Your first example is how I would typically handle this. However, if you look closely, the onclick is defined on the contained input element, not on the span. You need to get the xpath for that element and then call the onclick method.

Thank you very much for this! Now at least I can 'capture' the control. But I still cannot click it in a proper manner. The button 'freezes' (not normal behavior -- see the image below).

Here is my new code:

_FFXPath( "//input[@title='Search']")
    _FFCmd("FFau3.xpath.onclick()")

Here is the log for it:

 

Quote

__FFSend: FFau3.WCD=window.content.top.document;
__FFRecv: [object HTMLDocument] - {WOS_CombineSearches_input_form: {...}, OpenLocal: {...}, UA_options_input_form: {...}, openhist: {...}, UA_output_input_form: {...}, WOS_AdvancedSearch_input_form: {...}, savehist: {...}, ...}
[object HTMLDocument] - {WOS_CombineSearches_input_form: {...}, OpenLocal: {...}, UA_options_input_form: {...}, openhist: {...}, UA_output_input_form: {...}, WOS_AdvancedSearch_input_form: {...}, savehist: {...}, ...}
__FFSend: FFau3.xpath=null;try{FFau3.xpath=FFau3.WCD.evaluate("//input[@title='Search']",FFau3.WCD,null,XPathResult.FIRST_ORDERED_NODE_TYPE,null).singleNodeValue;}catch(e){'_FFXPath_Error: '+e;};
__FFRecv: [object HTMLInputElement] - {stepUp: function() {...}, stepDown: function() {...}, checkValidity: function() {...}, setCustomValidity: function() {...}, select: function() {...}, setRangeText: function() {...}, setSelectionRange: function() {...}, ...}
__FFSend: try{FFau3.xpath.onclick()}catch(e){'_FFCmd_Err';};
__FFRecv: 1

 

P.S. BTW, is there any way to edit my posts?

 

Capture.PNG

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...