Hi Stilgar,
Do you support "frame in frame" handling? Please help me with automation of my page. Unfortunately I cannot get a link to it as it is in our network with VPN, but I'll describe it. The page contains of different set of frames with "frame in frame" architecture:
Frame "Main" is located in browser page;
Frame "DataEntry" is located in frame "Main";
Form "form1" is located in frame "DataEntry";
Drop-down "PID" and text edit box "sfname" are located in form "form1".
My code is:
$FFInstance = _FFStart($g_sDataEntryLink)
$mainFrame = _FFFrameEnter("Main", "name")
$mainFrame = _FFFrameGetSelected("name")
MsgBox(0, "$mainFrame", $mainFrame)
$DataEntryFrame = _FFFrameEnter("DataEntry", "name")
$mainFrame = _FFFrameGetSelected("name")
MsgBox(0, "$DataEntryFrame", $DataEntryFrame)
Sleep (5000)
_FFFormOptionselect("PID", "name", "Custom HF Request", "name", "form1", "name")
$First_name = _FFGetValueByName("sfname", 3,0)
MsgBox(0, "$First_name", $First_name)
My script opens a page, then gives message box with "Main" (so it determines the first frame correctly). Second message box returns "-1", third one returns empty string (though I fill the sfname textbox while sleeping). "Custom HF Request" option is not set in a dropdown.
What I do wrongly?
Thank you for the updated library, I'm using it and I like it. But I'd suggest changing the function __FFIsURL.
Look: now all URLs like "localhost" or IP-like (XXX.XXX.XXX.XXX) are rejected by this function, and i can't even open my forst FF window.
I'd suggest this one:
Func __FFIsURL(ByRef $URL)
Return (StringRegExp($URL, '^^((ht|f)tp(s?)\:\/\/|~/|/)([\w]+:\w+@)?([a-zA-Z]{1}([\w\-]+\.)+([\w]{2,5}))(:[\d]{1,5})?((/?\w+/)+|/?)(\w+\.[\w]{3,4})?((\?\w+=\w+)?(&\w+=\w+)*)?') Or _
StringRegExp($URL,'^((ht|f)tp(s?)://)?(\d{1,3}\.){3}\d{1,3}(:[\d]{1,5})?(/.*)?$') Or _
StringLeft($URL, 6) = "about:" Or _
StringLeft($URL, 7) = "chrome:" Or _
StringLeft($URL, 10) = "localhost:" Or _
StringLeft($URL, 8) = "file:///")
EndFunc ;==>__FFIsURL
yes I know about it. But this thing is only working with FF V1.5! http://www.iol.ie/~locka/mozilla/mozilla.htm http://kb.mozillazine.org/ActiveX
And it crashes FF V2.x. We have V3.x now ...
The only other thing I found was an "An NPAPI based plugin for Firefox that enables the use of ActiveX controls": http://code.google.com/p/ff-activex-host/ but I don't know if this the right thing and it has many limits, because of the security riscs by ActiveX.
I know this method takes a different approach. But Authenticity posted a very nice link to automate FF like IE the other day... http://www.iol.ie/~locka/mozilla/control.htm If you're interested, or maybe want to expand in areas you may not have with the current setup.
Known problems: - The _FFTab* functions doesn't work, if you have the FF-AddOn TabMixPlus installed (this AddOn seems to override some internal FF-functions)