Danp2 Posted November 2, 2013 Posted November 2, 2013 You many want to review the code I previously posted >here to see if you can make this work with a single listener. Latest Webdriver UDF Release Webdriver Wiki FAQs
frank10 Posted November 2, 2013 Posted November 2, 2013 (edited) I used your mousemove together with another property of event: event.target , so all is simplified without the need of coord! #include <FF.au3> _FFConnect(Default, Default, 3000) _FFCmd("var evt=null;") _FFCmd("function listener(event) {evt = event};") _FFCmd("content.document.addEventListener('mousemove',listener, false);") while 1 local $element = _FFCmd("evt.target.nodeName;") _FFCmd("evt.target.href") Sleep(1000) WEnd BTW: In these examples I always used global var declared _FFCmd("var evt=null;") to access them with: _FFCmd("evt") With this method you can't access local var in func. Is it possible to directly access a variable inside a func? Like accessing "num" inside test()? _FFCmd("function test() { var num = 10 };") Edited November 2, 2013 by frank10
Danp2 Posted November 2, 2013 Posted November 2, 2013 No, a function's local variables shouldn't be accessible outside of the function. You could use _FFObjNew instead of declaring the global variable. Latest Webdriver UDF Release Webdriver Wiki FAQs
SupaNewb Posted December 6, 2013 Posted December 6, 2013 R.E. FF.au3 version 0.6.0.1b-10 Line # 4329 is missing a back-slash inside the function __FFStartProcess. $sHKLM &= 'Mozilla\Mozilla Firefox' Change to: $sHKLM &= 'Mozilla\Mozilla Firefox\' Thanks Stilgar for your awesome UDF!
13lack13lade Posted December 19, 2013 Posted December 19, 2013 im wanting to automate firefox like you can do with IE, am i correct in assuming i can do it using htis UDF and mozrepl? Ive installed mozrepl and the UDF and have tried some example scripts but getting errors.. ive tried reading the step by steps but without any luck
Danp2 Posted December 19, 2013 Posted December 19, 2013 Make sure you started MozRepl. (Tools > MozRepl). There's also an option to activate on startup. If that's not the issue, post more details regarding the errors that you are encountering. Latest Webdriver UDF Release Webdriver Wiki FAQs
13lack13lade Posted December 19, 2013 Posted December 19, 2013 (edited) Had that marked already, figured out what it was - telnet feature wasnt turned on in windows lmao. Now im having an issue with repl though if i press any button in cmd it straight away says referenceError - any idea for this? i know it is a little off topic.. could be permission restrictions maybe or? *EDIT* - all good, downloaded putty and now its working sweet yay! My 'view' of this is to automate firefox like you can do with IE in autoit... is my view of this correct? and do i need to do anything with mozrepl or just simply have it installed? Edited December 19, 2013 by 13lack13lade
Danp2 Posted December 19, 2013 Posted December 19, 2013 You should be good to go once mozrepl is installed and running. Latest Webdriver UDF Release Webdriver Wiki FAQs
13lack13lade Posted December 20, 2013 Posted December 20, 2013 (edited) Running sweet, this is absolutely brilliant! props to the creator! How do i enter say, a user name and password into a username and password box? Ive inspected the elements to get the information about the inputs: <input class="gwt-TextBox" type="text" name="j_username"></input> <input class="gwt-PasswordTextBox" type="password" name="j_password"> how does one input data into these input boxes? was looking at the commands closes thing i saw was _FFsetvalue but it didnt have any help attached with it.. Edited January 1, 2014 by 13lack13lade
Danp2 Posted December 23, 2013 Posted December 23, 2013 I'm observing the following in the output window of SciTE: __FFWaitForRepl ==> Error TCPSend / TCPRecv: TCPRecv :-1 I believed this started with the most recent update to b-9. Is this something to be concerned about? After more testing, it appears to only occur while using the current beta version. Dan Anyone else see this when running your script in Scite? Latest Webdriver UDF Release Webdriver Wiki FAQs
13lack13lade Posted January 2, 2014 Posted January 2, 2014 how do i simulate a click or form submit for this element? <button class="important" type="button">
hoangmrb Posted January 2, 2014 Posted January 2, 2014 Dear, im trying to make an autologin to this site :id.zing.vn <input tabindex="1" value="" autocomplete="off" class="input_login" type="text" name="u" id="login_account" placeholder="Tên, email hoặc số điện thoại"> and this is my code: #Include <FF.au3> _FFStart() $oFF1 = _FFOpenURL("https://id.zing.vn/v2?pid=38") _FFSetValueByName("u","Hoang") Although i can connect to FF but it keep saying that : "G:UsersBang HoangDesktopBlog.au3" (4) : ==> Unknown function name.: _FFSetValueByName("u","Hoang") ^ ERROR Any ideas to help me out
hoangmrb Posted January 2, 2014 Posted January 2, 2014 Dear, im trying to make an autologin to this site :id.zing.vn <input tabindex="1" value="" autocomplete="off" class="input_login" type="text" name="u" id="login_account" placeholder="Tên, email hoặc số điện thoại"> and this is my code: #Include <FF.au3> _FFStart() $oFF1 = _FFOpenURL("https://id.zing.vn/v2?pid=38") _FFSetValueByName("u","Hoang") Although i can connect to FF but it keep saying that : "G:UsersBang HoangDesktopBlog.au3" (4) : ==> Unknown function name.: _FFSetValueByName("u","Hoang") ^ ERROR Any ideas to help me out nevermind i found my problem
mootius Posted January 5, 2014 Posted January 5, 2014 Has anyone had any luck grabbing/utilizing the jQuery object for a page that has it loaded? AutoIt Example: _FFCmd("jQuery('#some_id').val()") <-- This would typically return a String with the value of the selected element. I've also tried: _FFCmd("jQuery('#some_id').val()", Default, 0) and _FFCmd("jQuery('#some_id').val()", Default, 1) I know it's redundant, but here are 2 JavaScript examples of getting and setting the value using jQuery: JavaScript Example: var $ = jQuery; // Getting the value $('#some_id').val(); // Gets the value of the element with id="some_id" // Setting the value $('#some_id').val('Hello World'); // Sets the value of the element with id="some_id" ...for even more redundancy...here is a bookmarklet that alerts the value in the browser: Bookmarklet Example: javascript:alert(jQuery('#some_id').val()); I think it's a scoping issue, but I'm not quite sure...I can run a bookmarklet with the same code and get the value returned, but for some reason have never been able to touch the jQuery object from within ff.au3. I have tried many variations of the _FFCmd function but just can't seem to grab it. If you have a working solution (aka no guesses) please let me know. Thanks!
13lack13lade Posted January 6, 2014 Posted January 6, 2014 (edited) How do you control buttons which are written in java, they dont have any name or id that i can see from the source... or is it not possible to do this? for example i inspect an element and all that is returned is - <div class="html-face"></div> however the other buttons say the same thing... anyway to interact with these? Edited January 7, 2014 by 13lack13lade
Stilgar Posted January 7, 2014 Author Posted January 7, 2014 @mootius: The function _FF_Call is for executing JavaScripts: FFEx.au3 @13lack13lade: You can interact with them e.g. with _FFXpath and _FFClick. Look please on the examples: _FFClick and _FFXpath The XPath can you copy from FireBug. jEdit4AutoIt PlanMaker_UDF
ozmike Posted January 9, 2014 Posted January 9, 2014 (edited) Hi the download the FF.au3 , from IE or Chrome - you get compile error... the end of line character or_ -> or _ FYI.. >"C:\Program Files (x86)\AutoIt3\SciTE\..\autoit3.exe" /ErrorStdOut "C:\Temp\mse2\cliphist2\FF2.au3" C:\Temp\mse2\cliphist2\FF2.au3 (3906) : ==> Missing separator character after keyword.: Return StringRegExp($IP, $sStart & '(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9])\.(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9]|0)\.(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9]|0)\.(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[0-9])' & $sEnd) Or_ Return StringRegExp($IP, $sStart & '(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9])\.(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9]|0)\.(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9]|0)\.(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[0-9])' & $sEnd) Or_^ ERROR >Exit code: 1 Time: 0.213 line 3906 Or_ -> Or _ (4 occurances) Edited January 9, 2014 by ozmike
Stilgar Posted January 9, 2014 Author Posted January 9, 2014 @ozmike: I've uploaded a corrected version. jEdit4AutoIt PlanMaker_UDF
mootius Posted January 11, 2014 Posted January 11, 2014 @mootius: The function _FF_Call is for executing JavaScripts: FFEx.au3 @13lack13lade: You can interact with them e.g. with _FFXpath and _FFClick. Look please on the examples: _FFClick and _FFXpath The XPath can you copy from FireBug. @stilgar: Brilliant! Thanks for the heads up. So now I am at a new quandary... If I use this code: _FF_Call("jQuery('#email').val('me@gmail.com')") It works as expected and sets the input element with the id=email to me@gmail.com. However if i then do this: _FF_Call("alert(jQuery('#email').val())") // Should return current value for input element with id=email It does not alert anything and the console logs an _FFReceive: _FFCmd Error Any ideas on that? It looks like _FF_Call is actually an _FFCmd with "content.JSWrappedObject." prepended to the string passed to _FF_Call, so I played around with different contexts but could not get an alert with a jquery command inside it to work... I even started playing with __FFSend, but still could not get it to alert the value... Confusing... Thanks!
frank10 Posted January 21, 2014 Posted January 21, 2014 I want to superimpose a pic from a local img on an Internet page that I'm visiting. I tried this code: _FFCmd("var WCD = window.content.document") _FFCmd("var imgX = document.createElement('img');") _FFCmd("imgX.setAttribute('src', 'file:///E:\\xxxxxx\\yyyyy.gif');") _FFCmd("WCD.getElementsByTagName('div')[3].appendChild(imgX)") But the img doesn't display. I tried to save the modified page locally and then reopen it and the img is visible. I think it's a problem of domain. How can it be done?
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