Laurynelis Posted July 9, 2017 Share Posted July 9, 2017 (edited) Hello everyone! Started playing with ff.au3 today and got into some problem with field inputs. I am using _FFSetValue('0.010','amount-input--0','id') and it is setting the field correctly, but the website (kraken, trading platform) refreshes every 10 sec or so (without reload, only ajax probably) and the fields are getting cleared. Note: values stay after refresh if I enter them manually. Is there any other method with ff.au3 to set fields correctly? Or maybe I am doing something wrong with the current method? Edited July 9, 2017 by Laurynelis Link to comment Share on other sites More sharing options...
Danp2 Posted July 9, 2017 Share Posted July 9, 2017 You may want to review this thread for one technique -- However, it's likely that you will run into the same issue because the site is using events to detect user input. Laurynelis 1 Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
Laurynelis Posted July 9, 2017 Author Share Posted July 9, 2017 (edited) Any info helps, thank you! Going to try and learn the xpath method tommorow. Don't want to give up and use "MouseClick" + "Send" functions just yet Edited July 9, 2017 by Laurynelis Link to comment Share on other sites More sharing options...
Danp2 Posted July 10, 2017 Share Posted July 10, 2017 Definitely don't give up! I was just pointing out that sometimes you have to jump through some hoops to get the automation working on some sites. Here's an example -- Laurynelis 1 Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
Laurynelis Posted July 10, 2017 Author Share Posted July 10, 2017 (edited) 19 hours ago, Danp2 said: Definitely don't give up! I was just pointing out that sometimes you have to jump through some hoops to get the automation working on some sites. Here's an example -- Good progress! This one was exactly what i needed. Thank you very much. Interestingly it does not work for sending '.' so i have to figure that out somehow. What i currently have: $sAmount = _FFObjGet("amount-input--0", "id") _FFSendReact($sAmount, "0,01") Func _FFSendReact($sElement, $sValue = "") If StringLeft($sElement, 7) = "OBJECT|" Then $sElement = StringMid($sElement, 8) If StringLeft($sElement, 1) = "." Then $sElement = "window.content.document" & $sElement _FFCmd('FFau3.sendReact=function sendReact(a,b){try{var c=FFau3.WCD.createEvent("KeyboardEvent");for (var i = 0, len = b.length; i < len; i++) {c.initKeyEvent("keypress",true,true,null,false,false,false,false,b.charCodeAt(i),b.charCodeAt(i));a.dispatchEvent(c);};return 1}catch(e){return-1}return 0};') _FFCmd("FFau3.sendReact(" & $sElement & ",'" & $sValue & "');") EndFunc Edited July 10, 2017 by Laurynelis Link to comment Share on other sites More sharing options...
Danp2 Posted July 10, 2017 Share Posted July 10, 2017 Actually, the last revision does work with a period. Try it out and let me know if you encounter any issues. Laurynelis 1 Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
Laurynelis Posted July 10, 2017 Author Share Posted July 10, 2017 3 minutes ago, Danp2 said: Actually, the last revision does work with a period. Try it out and let me know if you encounter any issues. Everything is perfecto now! Danp2 1 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