foozoor Posted November 4, 2012 Posted November 4, 2012 (edited) I do not know if this is enough? These are the last 4 lines in SciTE. __FFSend: try{FFau3.simulateEvent(FFau3.WCD.getElementById('file1'),'MouseEvents','click');}catch(e){'_FFCmd_Err';}; __FFRecv: 1 _FFLoadWait: . loaded in 10ms [object HTMLDocument] - {location: {...}, querySelector: function() {...}, querySelectorAll: function() {...}, evaluate: function() {...}, createExpression: function() {...}, createNSResolver: function() {...}, addEventListener: function() {...}, ...} Edited November 4, 2012 by foozoor
Danp2 Posted November 4, 2012 Posted November 4, 2012 Looks like FIreFox restricts you from manipulating this element for security reasons. You may be able to MouseMove / MouseClick to perform the desired action. Latest Webdriver UDF Release Webdriver Wiki FAQs
sleep365 Posted November 12, 2012 Posted November 12, 2012 Dear Danp2 i want to ask you a question that is when i changed a select object value use FF.au3,but the event on a select object can not run ,what should i do ? many web use ajax .
Danp2 Posted November 12, 2012 Posted November 12, 2012 You may want to repost your question in the General Help forum rather than in this thread. If you do so, it would help if you gave an example using a public website that we can all access. Latest Webdriver UDF Release Webdriver Wiki FAQs
sleep365 Posted November 13, 2012 Posted November 13, 2012 (edited) Dear Danp2Thank u very much!How could i get the web Text( UTF-8 Code) use _FFReadText? I am in china. The result is unrecognizable .#include <FF.au3>Local $wait_seconds = 3Local $sssIf _FFConnect() Then _FFOpenURL('http://www.baidu.com/') $sss=_FFReadtext(8) MsgBox(0,"",$sss)EndIfExit=========================================the text is what i want get搜索设置|登录注册新 闻 网 页 贴 吧 知 道 音 乐 图 片 视 频 地 图百科 文库 hao123 | 更多>>把百度设为主页把百度添加到桌面加入百度推广 | 搜索风云榜 | 关于百度 | About Baidu©2012 Baidu 使用百度前必读 京ICP证030173号 Edited November 13, 2012 by sleep365
HighlanderSword Posted December 19, 2012 Posted December 19, 2012 Hello,When ever I start an AU script that uses the FF.au2 UDF , it open the web page i tell it to go to as well as and errorpage that tells me "Firefox cant establish a connection to server at port 4242. I have validated that Mozrepl is started.Any Ideas what Im doing wrong ?Script is real simple#include <FF.au3>_ffstart(http://google.com)
JohnOne Posted December 19, 2012 Posted December 19, 2012 _ffstart("http://google.com") AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans.
HighlanderSword Posted December 19, 2012 Posted December 19, 2012 Soorry, I already have the quotes aroung the url , I manually typed it when I posted the question. I still have the same 2 Firefox sessions open one with google and the other with the error message
HighlanderSword Posted December 19, 2012 Posted December 19, 2012 ok, doing more digging and if I open a Mozilla Browser and sepcify in the autoit script to attach to an exiting session that works and the second page i was getting with the connection errors does not happen. I need a clean way to start a mozilla browser session via autoit as i plan to have the whol session hidden so the user will no be able to interact with it. Any Ideas what i should try ? I have replciated the original issue on 2 differnt computers.
HighlanderSword Posted January 12, 2013 Posted January 12, 2013 Hello, I hjave run into another issue I have the Html below Im trying to figure out how to click on the radio button next to User id . I have tried ffclick with no luck. Using the IE udf I use tagnamecollections to get to click the radio button. Below is the IE udf code. How would i replicate this using FF udf $objINPUTtags = _IETagNameGetCollection($oIE2,"input") ;seelct userid radio button For $objINPUTtag In $objINPUTtags ;$objINPUTtag.sourceIndex >0 and If stringinstr($objINPUTtag.value,'uid') > 0 Then _IEAction ( $objINPUTtag, "click") exitloop EndIf Next <!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html> <head> <META http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>Customer Admin : User Search Results</title> <link href="/css/main.css" type="text/css" rel="STYLESHEET"> <script SRC="/js/net/UserAgent.js" language="Javascript"></script><script SRC="/js/searches.js" language="Javascript1.2"></script><script SRC="/js/validation.js" language="Javascript1.2"></script><script SRC="/js/assignments.js" language="Javascript1.2"></script><script SRC="/js/Constants.js" language="Javascript1.2"></script><script SRC="/js//trigger.js" language="Javascript1.2"></script><script SRC="/js//searchOnEnter.js" language="Javascript1.2"></script> </head> <body onload="initSearch()" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" bgcolor="#ffffff"> <form method="post"> <input name="searchMethod" type="hidden" value="search_selectuser"><input name="searchType" type="hidden" value="portaluserSelect"><input name="searchStyle" type="hidden" value="portaluserSelect"><input name="embedded" type="hidden" value="false"><input name="offset" type="hidden" value="0"><input name="increment" type="hidden" value="20"><input value="false" name="newwindow" type="hidden"><input name="searchFilter" type="hidden" value=""><input name="assignToElement" type="hidden" value="uid"><input name="popup" type="hidden" value="true"> <div class="content"> <h3>User Search Results</h3> <em>** Remember, when using the User ID search, that this is an exact match search. If you do NOT know the User ID exactly, please use the Last Name search.</em> <table class="searchTable"> <tr> <th>Search By:</th><td><input onfocus="selectuserRB(this.form,'uid');clearSearchEmailAddr(this.form);clearSearchUserName(this.form)" value="uid" name="userRB" class="inputnoborder" type="radio"></td><td align="left">User ID:</td><td colspan="4"><input onfocus="selectuserRB(this.form,'uid');clearSearchUserName(this.form);clearSearchEmailAddr(this.form)" size="60" name="searchuid"></td> </tr> <tr> <td> </td><td><input onfocus="selectuserRB(this.form,'emailaddr');clearSearchUID(this.form);clearSearchUserName(this.form)" value="emailaddr" name="userRB" class="inputnoborder" type="radio"></td><td align="left">Email Address:</td><td colspan="4"><input onfocus="selectuserRB(this.form,'emailaddr');clearSearchUID(this.form);clearSearchUserName(this.form)" size="60" name="mail"></td> </tr> <tr> <td> </td><td><input onclick="clearSearchUID(this.form);clearSearchEmailAddr(this.form);" value="username" name="userRB" class="inputnoborder" type="radio" checked></td><td align="left">Last Name:</td><td><input onfocus="selectuserRB(this.form,'username');clearSearchUID(this.form);clearSearchEmailAddr(this.form);" size="20" name="sn"></td><td> </td><td align="right">First Name:</td><td><input onfocus="selectuserRB(this.form,'username');clearSearchUID(this.form);clearSearchEmailAddr(this.form);" size="20" name="givenname"></td> </tr> <tr> <td> </td><td> </td><td> </td><td align="right"><em>exact match: </em><input class="inputnoborder" value="EMsn" name="EMsn" type="checkbox"></td><td> </td><td> </td><td align="right"><em>exact match: </em><input class="inputnoborder" value="EMgivenname" name="EMgivenname" type="checkbox"></td> </tr> </table> <div class="actionsRow"> <a class="cssbutton" href="javascript:search(document.forms[0])"> Search </a> </div> <table class="resultsTable"> <thead> <tr> <th>Select</th><th>User Name</th><th>User ID</th><th>Company</th><th>Status</th><th>Relationship</th> </tr> </thead> <tbody></tbody> </table> </div> </form> </body> </html>
xatanu Posted January 31, 2013 Posted January 31, 2013 Hi, The funcions _FFFormCheckBox, _FFFormOptionselect and _FFFormRadioButton don't work for elements out of forms. Try for example using FFFormOptionselect function with the following page: http://www.tizag.com/htmlT/htmlselect.php Use for example: _FFFormOptionselect("selectionField","name","CO","value") It won't work. This happens because the select element is defined out of any forms and those functions construct an XPath starting always by //form[%s] I have added a couple of lines of code to check the value of the parameter $vForm, so you can use -1 for calling the functions when you want to refer to any element not defined inside a form. This code is for _FFFormCheckBox: If IsInt($vForm) And $vForm == -1 Then _FFXPath(StringFormat("//input[@type='%s' and %s]", $sType, $sCheckBox), $sCommand, 9) Else _FFXPath(StringFormat("//form[%s]//input[@type='%s' and %s]", $sForm, $sType, $sCheckBox), $sCommand, 9) EndIf Something similar can be added to _FFFormOptionselect. _FFFormRadioButton is just a wrapper for _FFFormCheckBox, so there is no need for changing it. You can then use this to change the value of the select box: _FFFormOptionselect("selectionField","name","CO","value",-1) Regards
babullika Posted March 16, 2013 Posted March 16, 2013 (edited) Hello! Can some one help to property get StatusBAr information ? I tryed _FFCmd("window.status") _FFCmd("content.window.status") _FFCmd("window.content.status") This doesnt work, help please!!! Edited March 16, 2013 by babullika
water Posted March 16, 2013 Posted March 16, 2013 First thing to do when something doesn't work as expected is error checking. What's the return value of function _FFCmd and the value of @error? My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
babullika Posted March 17, 2013 Posted March 17, 2013 (edited) Well, i do like this _FFConnect(Default, Default, 3000) sleep(3000) _FFCmd("window.status") _FFCmd("content.window.status") _FFCmd("window.content.status") sleep time helps me to put mouse on some link to see Status Bar message, but script cant read my StatusBar. In @error always 0. _FFConnect: Browser: Mozilla/5.0 (Windows NT 6.1; rv:19.0) Gecko/20100101 Firefox/19.0 __FFSendJavascripts: Sending functions to FireFox .......... done __FFSend: try{window.status}catch(e){'_FFCmd_Err';}; __FFRecv: __FFSend: try{content.window.status}catch(e){'_FFCmd_Err';}; __FFRecv: __FFSend: try{window.content.status}catch(e){'_FFCmd_Err';}; __FFRecv: >Exit code: 0 Time: 4.095 Edited March 17, 2013 by babullika
water Posted March 17, 2013 Posted March 17, 2013 Have you searched the forum? This suggests to use$Socket = _FFStart("[url="http://www.google.it"]http://www.google.it"[/url]) $sStatusText = _FFGetValue($Socket ,"window.content.status") My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
babullika Posted March 17, 2013 Posted March 17, 2013 (edited) Well where are no more function _FFGetValue(), it was replaced by _FFCmd(). I used search =)Well tryed your example and -_FFGetValue ==> Invalid value: (elements|id|name|class|tag) $sMode: window.content.statusMaybe some1 who use this StatusBar information, tell me your FF version and code, maybe i use new version and it is unsupported.. Edited March 17, 2013 by babullika
johnnymo87 Posted March 21, 2013 Posted March 21, 2013 (Crossposting from )I'm trying to script commands to a command line for a text-based MUD that runs in a firefox window. I can get text to appear in the text box, but I can't get it to submit. It's weird because I'm able to get text to submit when I insert _FFFormSubmit in the _FFObj documented example.I'm getting this error: _FFFormSubmit ==> No match: No Elements found in form: getElementById('input')Here is my code: #include <FF.au3> If _FFConnect(Default, Default, 10000) Then $sInput = _FFObjGet("input", "id") _FFObj($sInput, "value", "hello") _FFFormSubmit("input", "id") Else MsgBox(64, "", "Can't connect to FireFox!") EndIfHere is my source code (The code for the text box is a few lines up from the bottom):expandcollapse popup<?xml version="1.0"?> <window id="main-window" xmlns:html="http://www.w3.org/1999/xhtml" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" onload="onMainLoad();" onunload="onunload();" style="width:760px; height:480px;" orient="vertical" persist="width height" windowtype="skotos:zealotry"> <script type="application/x-javascript" src="chrome://zealotry/content/browser-compat.js"/> <script type="application/x-javascript" src="chrome://zealotry/content/my-world.js"/> <script type="application/x-javascript" src="chrome://zealotry/content/init.js"/> <script type="application/x-javascript" src="chrome://zealotry/content/jslib.js"/> <script type="application/x-javascript" src="chrome://zealotry/content/filesystem.js"/> <script type="application/x-javascript" src="chrome://zealotry/content/file.js"/> <script type="application/x-javascript" src="chrome://zealotry/content/utils.js"/> <script type="application/x-javascript" src="chrome://zealotry/content/md5.js"/> <script type="application/x-javascript" src="chrome://zealotry/content/connection-xpcom.js"/> <script type="application/x-javascript" src="chrome://zealotry/content/network.js"/> <script type="application/x-javascript" src="chrome://zealotry/content/client.js"/> <script type="application/x-javascript" src="chrome://zealotry/content/macro.js"/> <script type="application/x-javascript" src="chrome://zealotry/content/zealotry.js"/> <hbox style="-moz-box-flex: 1"> <iframe name="left-frame" id="left-frame" type="content" style="-moz-box-flex: 0; width: 145px; height: 100%; overflow: hidden" src="about:blank"/> <keyset> <key id="dict-key" keycode="VK_F2" oncommand="helpMenuInit('dictionary');"/> </keyset> <vbox style="-moz-box-flex: 1"> <toolbox> <menubar id="sample-menubar"> <menu id="file-menu" label="File" accesskey="F"> <menupopup id="file-popup" onpopupshowing="fileMenuInit();"> <menuitem id="menuitem_logging" type="checkbox" accesskey="L" label="Logging..." oncommand="onToggleLogging(event);"/> <menuitem id="menuitem_autolog" type="checkbox" accesskey="A" label="AutoLog..." oncommand="onToggleAutoLog(event);"/> <menuseparator/> <menuitem label="Exit" oncommand="window.close();" keycode="VK_F4"/> </menupopup> </menu> <menu id="edit-menu" label="Edit" accesskey="E"> <menupopup id="edit-popup" onpopupshowing="editMenuInit();"> <menuitem id="menuitem_copy" label="Copy" oncommand="oncopy();" accesskey="C"/> <menuitem id="menuitem_paste" label="Paste" oncommand="onpaste();" accesskey="P"/> <!-- menuseparator/> <menuitem label="Load Macros" accesskey="O" oncommand="window.myMacros.processMacroCommand('LOAD');"/> <menuitem label="Save Macros" accesskey="A" oncommand="window.myMacros.processMacroCommand('STORE');"/> <menuseparator/> <menuitem label="Load Config" accesskey="L" oncommand="readConfigurationFile('menu');"/> <menuitem label="Save Config" accesskey="S" oncommand="writeConfigurationFile();"/ --> </menupopup> </menu> <menu id="font-and-size" label="Options" accesskey="O"> <menupopup id="fonts-and-sizes-menu" onpopupshowing="optionMenuInit();"> <menuitem label="Preferences" oncommand="doPrefs();"/> </menupopup> </menu> <menu id="help" label="Help" accesskey="H"> <menupopup id="help-popup"> <menuitem label="Help Contents" oncommand="helpMenuInit('content');" accesskey="H"/> <menuitem label="Changelog Notes" oncommand="helpMenuInit('changelog');" accesskey="C"/> <menuitem label="Whats New?" oncommand="helpMenuInit('new');" accesskey="N"/> <menuseparator/> <menuitem label="About Zealotry" oncommand="helpMenuInit('about');" accesskey="A"/> </menupopup> </menu> </menubar> </toolbox> <!-- iframe name="scrollback" id="scrollback" type="content" style="min-height: 70%; max-height: 70%" src="about:blank"/> <splitter id="scroll_splitter" state="collapsed" collapse="before"> <grippy/> </splitter --> <iframe name="center-frame" id="center-frame" type="content" flex="1" src="about:blank"/> <splitter state="open" collapse="before"/> <textbox spellcheck="true" autostretch="true" style="margin: 0; padding: 0" onkeypress="onInput();" rows="2" multiline="true" id="input"/> </vbox> <iframe name="right-frame" id="right-frame" type="content" style="-moz-box-flex: 0; width: 145px; height: 100%; overflow: hidden" src="about:blank"/> </hbox> </window>Alternatively, if I can somehow use the _FFObj function to submit keys like {ENTER}, that would solve my problem, but I don't know how to do that either ... I see older versions of FF.au3 had a DispatchKeyEvent function that might help me, but it's no longer available. I opened FF and I noticed one hopeful thing: _FFCmd('FFau3.simulateEvent=function simulateEvent(a,b,c){try{var d=document.createEvent(b);switch(b){case"MouseEvents":d.initMouseEvent(c,true,true,window,0,0,0,simulateEvent.arguments[4],simulateEvent.arguments[5],false,false,false,false,0,null);break;case"KeyboardEvent":d.initKeyEvent(c,true,true,null,false,false,false,false,simulateEvent.arguments[3],0);break;case"Event":d.initEvent(c,true,true);break}a.dispatchEvent(d);return 1}catch(e){return-3}return 0};') It seems that _FFCmd can do key events. Anyone with more knowledge than me want to take a guess at how to setup the parameters to simulate an ENTER keystroke?
babullika Posted March 21, 2013 Posted March 21, 2013 _FFDispatchEvent(_FFObjGet("input", "id"), "keypress", 13) This ill send ENTER. Or Just a ControlSend("[CLASS:MozillaWindowClass]", "", "", "{ENTER}")
johnnymo87 Posted March 21, 2013 Posted March 21, 2013 Thank you very much, babullika! Your second option worked for me. The first one didn't, and for science, I'll post the error message below. But I'm good now, thanks! _FFConnect: OS: WIN_7 WIN32_NT 7601 Service Pack 1 _FFConnect: AutoIt: 3.3.8.1 _FFConnect: FF.au3: 0.6.0.1b-3 _FFConnect: IP: 127.0.0.1 _FFConnect: Port: 4242 _FFConnect: Delay: 2ms _FFConnect: Socket: 612 _FFConnect: Browser: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:19.0) Gecko/20100101 Firefox/19.0 __FFSendJavascripts: Sending functions to FireFox .......... done __FFSend: try{window.content.top.document.getElementById('input')?1:0;}catch(e){'_FFCmd_Err';}; __FFRecv: 1 __FFSend: try{window.content.top.document.getElementById('input').hasAttribute('value')}catch(e){'_FFCmd_Err';}; __FFRecv: 0 __FFSend: try{window.content.top.document.getElementById('input').value='hello world'}catch(e){'_FFCmd_Err';}; __FFRecv: hello world __FFSend: try{FFau3.simulateEvent(window.content.top.document.getElementById('input'),'KeyboardEvent','keypress',13);}catch(e){'_FFCmd_Err';}; __FFRecv: 1
atzoref Posted April 18, 2013 Posted April 18, 2013 Hi, How can I implement this IE functions: Local $oTable = _IETableGetCollection($oIE, 0) Local $aTableData = _IETableWriteToArray($oTable, True) $iIndex = _ArraySearch($aTableData, $strField, 0, 0, 0, 0, 1, 0) $strValue = $aTableData[$iIndex][1] with this FF include: FF V0.6.0.1b-8.au3 Thanks
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