AlexeyP Posted August 3, 2016 Share Posted August 3, 2016 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 More sharing options...
Danp2 Posted August 3, 2016 Share Posted August 3, 2016 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. AlexeyP 1 Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
AlexeyP Posted August 4, 2016 Author Share Posted August 4, 2016 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? Link to comment Share on other sites More sharing options...
AlexeyP Posted August 4, 2016 Author Share Posted August 4, 2016 UPD: I've made it out. Changed 'onclick()' to 'click()': _FFXPath( "//input[@title='Search']") _FFCmd("FFau3.xpath.click()") Now it seems to be working fine. Once more, THANK YOU! Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now