LOULOU Posted October 6, 2009 Posted October 6, 2009 I want to access to the code of an popup window. How can i do ? Thanks
Stilgar Posted October 14, 2009 Author Posted October 14, 2009 (edited) Updated to V0.5.3.9bLook at the first post for changes, please.--------------------@Leiif:At first you must safe the FF.au3 as au3-file in your include-directory e.g.c:\Program Files\AutoIt\include\FF.au3If you wanna use it in your programm then "include" it like every other UDF e.g.#include <FF.au3>Expample:#include <FF.au3> _FFStart("http://example.com")For reading the urls and informations from files look at the File*-functions please.Other example:#include <FF.au3> _FFStart() ; just starting the browser If _FFIsConnected() Then _FFOpenURL("http://ff-au3-example.thorsten-willert.de/") ; opens a webpage _FFSetValueByName("lname", "Name") ; insert your data into the input "Vorname" with the attribut name="lname" _FFFormSubmit() ; submits the formular EndIf--------------------@LOULOU:Select the window with _FFWindowSelect() - without parameters it uses the last opened window Edited October 14, 2009 by Stilgar jEdit4AutoIt PlanMaker_UDF
cypher175 Posted October 15, 2009 Posted October 15, 2009 How can I convert this AutoIt IE Code to FF AutoIt functions..?? $GetFormTags = _IETagNameGetCollection($IE, 'FORM') $NumFormTags = @extended For $i = 0 to $NumFormTags - 1 $Form = _IETagNameGetCollection($IE, 'FORM', $i) MsgBox(0,"", $Form.Name&@CRLF&$Form.Action) Next
Stilgar Posted October 15, 2009 Author Posted October 15, 2009 How can I convert this AutoIt IE Code to FF AutoIt functions..?? $GetFormTags = _IETagNameGetCollection($IE, 'FORM') $NumFormTags = @extended For $i = 0 to $NumFormTags - 1 $Form = _IETagNameGetCollection($IE, 'FORM', $i) MsgBox(0,"", $Form.Name&@CRLF&$Form.Action) Next The simplest way would be this: $aName = _FFXpath("//form", "name", 6) $aAction = _FFXpath("//form", "action", 6) For $i = 1 To $aName[0] MsgBox(0,"", $aName[$i] & @CRLF & $aAction[$i]) Next jEdit4AutoIt PlanMaker_UDF
cypher175 Posted October 15, 2009 Posted October 15, 2009 Does that do the same thing as my code does though.?? I need it to get all the Forms on a page, then MsgBox the ( Form.Name & Form.Action ) of each Form on that page..
Stilgar Posted October 15, 2009 Author Posted October 15, 2009 Does that do the same thing as my code does though.??I need it to get all the Forms on a page, then MsgBox the ( Form.Name & Form.Action ) of each Form on that page..Yes, it's the same thing. jEdit4AutoIt PlanMaker_UDF
Danp2 Posted October 18, 2009 Posted October 18, 2009 I'm having an issue with the _FFWindowGetHandle() function where is doesn't reset the title properly. For example: #include <FF.au3> If Not _FFIsConnected() And Not _FFConnect(Default, Default, 100) Then MsgBox(64, "", "Can't connect to FireFox!") Else $result = _FFWindowSelect("www.google.com","href", False) MsgBox(0,'test',_FFCmd(".title")) EndIf This code returns "FFAU31347304041" instead of "Google" or "iGoogle". I changed _FFWindowGetHandle as follows, which seems to fix the issue: Func _FFWindowGetHandle() Local Const $sFuncName = "_FFWindowGetHandle" ; in the future to handle with XPCOM =#= Local $bErr = False Local $hWindow = "" BlockInput(1) ; =#= If Not @error Then Local $sTitle = _FFCmd(".title") Local $sTitleRnd = "FFAU3" & Random(1000000000, 9999999999, 1) _FFCmd(".title='" & $sTitleRnd & "'") Local $iMatchMode = AutoItSetOption("WinTitleMatchMode", 1) Sleep(500) $hWindow = WinGetHandle($sTitleRnd) If @error Then $bErr = True AutoItSetOption("WinTitleMatchMode", $iMatchMode) ; _FFCmd("document.title=window.content.top.document.getElementsByTagName('title')[0].textContent") _FFCmd(".title='" & $sTitle & "'") ConsoleWrite("_FFWindowGetHandle: " & $hWindow & @CRLF) EndIf BlockInput(0) If $bErr Then SetError(__FFError($sFuncName, $_FF_ERROR_GeneralError)) Return $hWindow EndFunc ;==>_FFWindowGetHandle Thoughts? Latest Webdriver UDF Release Webdriver Wiki FAQs
cypher175 Posted October 18, 2009 Posted October 18, 2009 (edited) The simplest way would be this: $aName = _FFXpath("//form", "name", 6) $aAction = _FFXpath("//form", "action", 6) For $i = 1 To $aName[0] MsgBox(0,"", $aName[$i] & @CRLF & $aAction[$i]) Next so how would I set the input text of a form that had a certain string in its Form.Action..?? so say the Form.Action contains ".php" how would i set the Input.Text of that form to "123" then untick all the checkboxes belonging to that form and then submit that form..?? Edited October 19, 2009 by cypher175
Stilgar Posted October 19, 2009 Author Posted October 19, 2009 (edited) @DanP2: Reseting the title with this line: _FFCmd("document.title=window.content.top.document.getElementsByTagName('title')[0].textContent") is to avoid problems with different codepages. But it seems there was something changed in latest FF-versions ... I have fixed the problem in the latest test-version: http://thorsten-willert.de/Themen/FFau3/Testversion/FF.au3 ---- Your example would better look like this: #include <FF.au3> _FFConnect(Default, Default, 100) If _FFIsConnected() Then $result = _FFWindowSelect("www.google.com","href", False) MsgBox(0,'test',_FFCmd(".title")) Else MsgBox(64, "", "Can't connect to FireFox!") EndIf because _FFIsConnected are only usefull after the use of _FFConnect or _FFStart. Or shorter: #include <FF.au3> If _FFConnect(Default, Default, 100) Then $result = _FFWindowSelect("www.google.com","href", False) MsgBox(0,'test',_FFCmd(".title")) Else MsgBox(64, "", "Can't connect to FireFox!") EndIf so how would I set the input text of a form that had a certain string in its Form.Action..?? so say the Form.Action contains ".php" how would i set the Input.Text of that form to "123" then untick all the checkboxes belonging to that form and then submit that form..?? _FFConnect() If _FFIsConnected() Then $aName = _FFXpath("//form", "name", 6) $aAction = _FFXpath("//form", "action", 6) For $i = 1 To $aName[0] MsgBox(0,"", $aName[$j] & @CRLF & $aAction[$j]) If $aAction[$j] = "/file.php" Then _FFXpath("//form[" & $j & "]//input[@type='checkbox']", "checked=false", 6) ; unchecking ALL checkboxes in this form _FFSetValueByName("NameOfTheInput", "123") ; or _FFSetValueById("IDOfTheInput", "123") _FFFormSubmit($i-1) ; -1 because of the DOM-index from 0-n ExitLoop EndIf Next EndIf If you don't wanna search the IDs and names in the HTML-Source you can use this function: http://www.autoitscript.com/forum/index.php?showtopic=103270 Edited October 19, 2009 by Stilgar jEdit4AutoIt PlanMaker_UDF
Danp2 Posted October 19, 2009 Posted October 19, 2009 I have fixed the problem in the latest test-version:http://thorsten-willert.de/Themen/FFau3/Testversion/FF.au3Yes, looks much better. Thanks!Using the _IEAttach function, I can address a specific tab by URL. I've tried using _FFWindowSelect, but it only succeeds if the desired tab is already selected. Is there a way to do this using the existing architecture?FWIW, I played around with this over the weekend and ended up adding the function FFau3.SearchTabURL. I then modified some of the _FFTab* functions to allow for sMode = 'href'. If you're interested, I can send you the modified source.Dan Latest Webdriver UDF Release Webdriver Wiki FAQs
Danp2 Posted October 19, 2009 Posted October 19, 2009 I am trying to check @error after calling_FFWindowSelect, but it's always zero (even when I know the function failed). Anybody else seeing this? Latest Webdriver UDF Release Webdriver Wiki FAQs
cypher175 Posted October 19, 2009 Posted October 19, 2009 (edited) @Stilgar.. How would I check the state (checked=true/false) of a CheckBox by its NAME..?? And then do something based on its Checked State..?? also is there a function like .ScrollIntoView() that focuses the webpage on a certain element..?? Edited October 20, 2009 by cypher175
LOULOU Posted October 20, 2009 Posted October 20, 2009 _FFlinksGetall() works with version 0.5.3.8b and with higher version doesn't works and return anything.
Stilgar Posted October 21, 2009 Author Posted October 21, 2009 @DanP2: In _FFWindowSelect I forget to build in the selection by URL, it's the same like selection by tab-label. Yes you can send me the modified source, please. Right the @error from _FFWindowSelect isn't always correct, but it the function returns 0 if it fails, otherwise 1. @cypher175: Checkbox: Currently only via xpath: $Checked = _FFXpath("//input[@type='checkbox' and @name='name'], "checked", 9) I change this in the next version. Scrolling: You can use this function: http://www.thorsten-willert.de/Themen/FFau3/Beispiele/FFElementGetPosition.au3 to get the position ot the element and then scroll to it via: _FFAction("ScrollXY", $iX, $iY) @LOULOU: Strange, here it works and I changed nothing in this function. Have you any error messages in your console-output? jEdit4AutoIt PlanMaker_UDF
Danp2 Posted October 21, 2009 Posted October 21, 2009 @Stiglar: Sent you an email w/ code. Latest Webdriver UDF Release Webdriver Wiki FAQs
cypher175 Posted October 27, 2009 Posted October 27, 2009 Is there any FF function to do this: _IEAction($IE, "stop") to stop FF that is still loading a page..??
Stilgar Posted October 27, 2009 Author Posted October 27, 2009 @DanP2:Thank you!----Is there any FF function to do this: _IEAction($IE, "stop") to stop FF that is still loading a page..??_FFAction("stop") jEdit4AutoIt PlanMaker_UDF
cypher175 Posted October 31, 2009 Posted October 31, 2009 @Stiglar: Is there any other _FFCmd's like the ones below to Clear "Everything" from FF's "Recent History"..?? ; Cookies _FFCmd("Components.classes['@mozilla.org/cookiemanager;1'].getService(Components.interfaces.nsICookieManager).removeAll();") ; History _FFCmd("Components.classes['@mozilla.org/browser/nav-history-service;1'].getService(Components.interfaces.nsIBrowserHistory).removeAllPages();") ; Cache _FFCmd("Ci=Components.interfaces;Components.classes['@mozilla.org/network/cache-service;1'].getService(Ci.nsICacheService).evictEntries(Ci.nsICache.STORE_ANYWHERE);")
Ontosy Posted November 1, 2009 Posted November 1, 2009 Do it is possibile to toggle offline status in Thunderbird via AutoIt3?
Stilgar Posted November 3, 2009 Author Posted November 3, 2009 Is there any other _FFCmd's like the ones below to Clear "Everything" from FF's "Recent History"..??I'm not sure what you mean. Do you searching anything other then the second _FFCmd(..) ?@Ontosy:MozRepl doesn't work with Thunderbird.But you can ask the author of it if he can change this:http://groups.google.de/group/mozlab?hl=de jEdit4AutoIt PlanMaker_UDF
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