tommytx Posted February 17, 2015 Share Posted February 17, 2015 Is there a FF command that is equal to the IE attach command? Thanks Link to comment Share on other sites More sharing options...
Danp2 Posted February 17, 2015 Share Posted February 17, 2015 Are you using the FF.au3 UDF? If so, take a look at _FFWindowSelect and _FFTabSetSelected. Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
tommytx Posted February 17, 2015 Author Share Posted February 17, 2015 How do I know if I am using it... ? Is it something I need to search for and activate... I did not add anything to my basic autoit.. Link to comment Share on other sites More sharing options...
JohnOne Posted February 17, 2015 Share Posted February 17, 2015 Here is a link to the FireFox UDF thread '?do=embed' frameborder='0' data-embedContent>> Read it, follow the instructions and try some examples. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
tommytx Posted February 17, 2015 Author Share Posted February 17, 2015 Thanks JohnOne I got that set up and seems to be working ok.. but its still not letting me connect... here is what I got so far. #include <FF.au3> _FFStart("http://vahud.com") If _FFIsConnected() Then consolewrite("Connected." & @CRLF) sleep(1000) _FFWindowSelect("Virginia Beach Real Estate For Sale! | Virginia Beach, VA Real Estate For Sale") endif and here is the errors that it is giving.. me... __FFStartProcess: ""C:\Program Files\Mozilla Firefox\firefox.exe" -new-window "http://vahud.com" "-repl 4242 " _FFConnect: OS: WIN_XP WIN32_NT 2600 Service Pack 3 _FFConnect: AutoIt: 3.3.12.0 _FFConnect: FF.au3: 0.6.0.1b-10 _FFConnect: IP: 127.0.0.1 _FFConnect: Port: 4242 _FFConnect: Delay: 2ms _FFConnect: Socket: 1648 _FFConnect: Browser: Mozilla/5.0 (Windows NT 5.1; rv:35.0) Gecko/20100101 Firefox/35.0 __FFSendJavaScripts: Sending functions to FireFox .......... done _FFLoadWait: . loaded in 14ms [object HTMLDocument] - {location: {...}, location: {...}, getElementsByName: function() {...}, getItems: function() {...}, open: function() {...}, close: function() {...}, write: function() {...}, ...} __FFSend: try{FFau3 != null?1:0}catch(e){'_FFCmd_Err';}; __FFRecv: 1 Connected. __FFSend: try{FFau3.SelectWin('Virginia Beach Real Estate For Sale!','title','navigator:browser');}catch(e){'_FFCmd_Err';}; __FFRecv: _FFCmd_Err _FFWindowSelect ==> No match: $sSearch: Virginia Beach Real Estate For Sale! >Exit code: 0 Time: 5.865 IF anyone has any suggestions as to why I do not get a match i would appreciate it.. Link to comment Share on other sites More sharing options...
Danp2 Posted February 17, 2015 Share Posted February 17, 2015 _FFWindowSelect will work with a portion of the title. Try changing your line to: _FFWindowSelect("Virginia Beach Real Estate") Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
Danp2 Posted February 17, 2015 Share Posted February 17, 2015 Also, there's an updated version of FF.au3, which you can download here. Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
tommytx Posted February 18, 2015 Author Share Posted February 18, 2015 I did try with the line on the left side of the bar but it failed the same way.... i had already assumed it only needs part of the title..but will upload the new version and try again.. thanks Link to comment Share on other sites More sharing options...
tommytx Posted February 18, 2015 Author Share Posted February 18, 2015 Notice the new version has the version number as part of the file name... can someone tell me where I save this for upgrade and do i need to change its name to FF.AU3 to make it get picked up.. Thanks Link to comment Share on other sites More sharing options...
Danp2 Posted February 18, 2015 Share Posted February 18, 2015 This works: _FFWindowSelect("vahud.com", 'href') I'd have to look that the underlying code to figure out why the title search isn't working. As far as the UDF name, you can just rename it to FF.au3 or change your script to use the different name. Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
Danp2 Posted February 18, 2015 Share Posted February 18, 2015 I took a look at the JS code in the UDF, and I believe that I have a fix for the title search not working properly. Find the line _FFCmd('FFau3.SelectWin=function SelectWin(a,b,c){var d;var e=Components.classes["@mozilla.org/appshell/window-mediator;1"].getService(Components.interfaces.nsIWindowMediator).getEnumerator(c);while(e.hasMoreElements()){d=e.getNext();switch(b){case"title":if(d.title.indexOf(a)!=-1){repl.enter(d);return 1};break;case"label":if(FFau3.SearchTab(a)>-1){repl.enter(d);return 1};break;case"href":for(var f=0; f < d.gBrowser.browsers.length; f++){var g=d.gBrowser.getBrowserAtIndex(f);if (RegExp(a).test(g.currentURI.spec)){repl.enter(g);return 1;}};break;default:return-1}}return-1};') and replace it with _FFCmd('FFau3.SelectWin=function SelectWin(a,b,c){var d;var e=Components.classes["@mozilla.org/appshell/window-mediator;1"].getService(Components.interfaces.nsIWindowMediator).getEnumerator(c);while(e.hasMoreElements()){d=e.getNext();switch(b){case"title":for(var f=0; f < d.gBrowser.browsers.length; f++){var g=d.gBrowser.getBrowserAtIndex(f);if (RegExp(a).test(g.contentTitle)){repl.enter(g);return 1;}};break;case"label":if(FFau3.SearchTab(a)>-1){repl.enter(d);return 1};break;case"href":for(var f=0; f < d.gBrowser.browsers.length; f++){var g=d.gBrowser.getBrowserAtIndex(f);if (RegExp(a).test(g.currentURI.spec)){repl.enter(g);return 1;}};break;default:return-1}}return-1};') Please test and let me know how this change works for you. Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
tommytx Posted February 19, 2015 Author Share Posted February 19, 2015 thanks for all that effort Universalist.. but what that did is bring up a blank new tab... and nothing else.. and I tried it using 3 differnet instance of firefox browser and also with one ff browser with 3 instances of tab... Thank you but don't waste more time on it as it may be realated to the fact that I am running XP and FF8... as that is the best XP can do... as its been abandoned.. Link to comment Share on other sites More sharing options...
Danp2 Posted February 19, 2015 Share Posted February 19, 2015 FWIW, all versions of FF run just fine on XP. Did you edit the UDF and replace the first line with the second one? Latest Webdriver UDF Release Webdriver Wiki FAQs 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