Jump to content
skyhigh

Set a reaction if Firefox crashes - FF.au3

Recommended Posts

skyhigh

Examples

Is it possible for ff.au3 or Autoit to pause the script if Firefox crashes? The script I am working on opens and closes a series of random URLs taken from an array.

If I close FF simulating a crash I get this error (taken from the SciTE log):

__FFWaitForRepl ==> MozRepl Exception: !!! [Exception... "Failure"  nsresult: "0x80004005 (NS_ERROR_FAILURE)"

Or this, depending on when I close FF

_FFCmd ==> Error return value
.__FFSend ==> Error TCPSend / TCPRecv: TCPSend: try{FFau3.tmp=window.getBrowser().webProgress;FFau3.tmp.isLoadingDocument && FFau3.tmp.busyFlags ? false: true;}catch(e){'_FFCmd_Err';};

Or both, right in the order I reported them.

Can you help me?  

Share this post


Link to post
Share on other sites
Melba23

skyhigh,

Why do you want this thread to be locked?

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites
skyhigh

Because my situation, and therefore the question, changed and is no longer about ff.au3.

Share this post


Link to post
Share on other sites
TheDcoder

@skyhigh There is no need to lock it unnecessarily, Just post a message & stop bothering about this thread ;)

 

Edit: Or you can edit your first post to change the title of this thread :D

Edited by TheDcoder

AutoIt.4.Life Clubrooms - Life is like a Donut (secret key)

Spoiler

My contributions to the AutoIt Community

If I have hurt or offended you in anyway, Please accept my apologies, I never (regardless of the situation) mean to do that to anybody!!!

3fHNZJ.gif

PLEASE JOIN ##AutoIt AND HELP THE IRC AUTOIT COMMUNITY!

Share this post


Link to post
Share on other sites
skyhigh

Ok, thank you. :)

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Similar Content

    • Carm01
      By Carm01
      All,
      I have decided to release my code for the automated clean install, set up and configuration of Mozilla Firefox with a Mozilla.cfg file included in my example as well. I seen an older version of this and decided to post mine on here. This is Windows 10 friendly.
      The whole process once compiled executes in about 15 seconds on my machine from start to finish as it is extremely fast.
      If you want to include your own Mozilla.cfg into the mix simply place Your Mozilla.cfg file in the same directory as the exe when it is run. If you do not wish to embed the Mozilla.cfg file into the script as a back up in case you forget you need to remove that line of code to embed it.
      I hope this helps some people esp those wanting to understand how to use a cfg file to set default settings for all users without having to do it by putting all those files and folders in the defaultapp data folders.
      #RequireAdmin #Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_Icon=Clear-App-firefox.ico #AutoIt3Wrapper_Outfile=FirefoxUpdater(x64Stable)_x.exe #AutoIt3Wrapper_Compression=4 #AutoIt3Wrapper_UseUpx=y #AutoIt3Wrapper_UseX64=y #AutoIt3Wrapper_Res_Comment=Preformes a clean install of Firefox 64bit Stable version. Auto downloads latest version. #AutoIt3Wrapper_Res_Description=Updates to the Latest 64bit Stable #AutoIt3Wrapper_Res_Fileversion=2.5.0.0 #AutoIt3Wrapper_Res_ProductVersion=2.5.0.0 #AutoIt3Wrapper_Res_Language=1033 #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** #include <InetConstants.au3> #include <EventLog.au3> #include <Inet.au3> #include <File.au3> #include <array.au3> #include <Misc.au3> #include <TrayConstants.au3> ; Required for the $TRAY_CHECKED and $TRAY_ICONSTATE_SHOW constants. If UBound(ProcessList(@ScriptName)) > 2 Then Exit TraySetToolTip("Firefox Updater") HotKeySet("^!m", "MyExit") ; ctrl+Alt+m kills program ( hotkey ) Opt("TrayMenuMode", 3) ; The default tray menu items will not be shown and items are not checked when selected. These are options 1 and 2 for TrayMenuMode. Opt("TrayOnEventMode", 1) ; Enable TrayOnEventMode. TrayCreateItem("About") TrayItemSetOnEvent(-1, "About") TrayCreateItem("") ; Create a separator line. TrayCreateItem("Exit") TrayItemSetOnEvent(-1, "ExitScript") TraySetOnEvent($TRAY_EVENT_PRIMARYDOUBLE, "About") ; Display the About MsgBox when the tray icon is double clicked on with the primary mouse button. TraySetState($TRAY_ICONSTATE_SHOW) ; Show the tray menu. Local $sVersion, $CVersion, $ecode ;https://www.mozilla.org/en-US/firefox/developer/all/ ;https://www.mozilla.org/en-US/firefox/all/# ;https://www.mozilla.org/en-US/firefox/all/#en-US ;https://www.mozilla.org/en-US/firefox/beta/all/#en-US ;https://archive.mozilla.org/pub/firefox/candidates/48.0b1-candidates/build2/ ;https://archive.mozilla.org/pub/firefox/candidates/ getfiles() compare() killapps() uninstall() dlinstall() Exit Func killapps() ; kill firefox and plugin if running If FileExists("C:\Program Files\Mozilla Firefox\") Then $cmd = "taskkill.exe /im firefox.exe /f /t" RunWait('"' & @ComSpec & '" /c ' & $cmd, @SystemDir, @SW_HIDE) Sleep(300) $cmd = "taskkill.exe /im plugin* /f /t" RunWait('"' & @ComSpec & '" /c ' & $cmd, @SystemDir, @SW_HIDE) Sleep(300) Call("remcfg64") EndIf If FileExists("C:\Program Files (x86)\Mozilla Firefox\") Then $cmd = "taskkill.exe /im firefox.exe /f /t" RunWait('"' & @ComSpec & '" /c ' & $cmd, @SystemDir, @SW_HIDE) Sleep(300) $cmd = "taskkill.exe /im plugin* /f /t" RunWait('"' & @ComSpec & '" /c ' & $cmd, @SystemDir, @SW_HIDE) Sleep(300) Call("remcfg32") EndIf EndFunc ;==>killapps Func remcfg64() ; delete existing config file if exist $SSlist = _FileListToArrayRec("C:\Program Files\Mozilla Firefox\", "*", $FLTAR_FILES, $FLTAR_RECUR, $FLTAR_NOSORT, $FLTAR_FULLPATH) For $i = 1 To UBound($SSlist) - 1 If StringInStr($SSlist[$i], "mozilla.cfg") > 1 Then FileDelete($SSlist[$i]) ElseIf StringInStr($SSlist[$i], "override.ini") > 1 Then FileDelete($SSlist[$i]) ElseIf StringInStr($SSlist[$i], "local-settings.js") > 1 Then FileDelete($SSlist[$i]) EndIf Next EndFunc ;==>remcfg64 Func remcfg32() $SSlist = _FileListToArrayRec("C:\Program Files (x86)\Mozilla Firefox\", "*", $FLTAR_FILES, $FLTAR_RECUR, $FLTAR_NOSORT, $FLTAR_FULLPATH) For $i = 1 To UBound($SSlist) - 1 If StringInStr($SSlist[$i], "mozilla.cfg") > 1 Then FileDelete($SSlist[$i]) ElseIf StringInStr($SSlist[$i], "override.ini") > 1 Then FileDelete($SSlist[$i]) ElseIf StringInStr($SSlist[$i], "local-settings.js") > 1 Then FileDelete($SSlist[$i]) EndIf Next EndFunc ;==>remcfg32 Func uninstall() ; uninstall existing Firefox If FileExists("C:\Program Files\Mozilla Firefox\Firefox.exe") Then ShellExecuteWait("helper.exe", " /S", "C:\Program Files\Mozilla Firefox\uninstall") EndIf If FileExists("C:\Program Files (x86)\Mozilla Firefox\Firefox.exe") Then ShellExecuteWait("helper.exe", " /S", "C:\Program Files (x86)\Mozilla Firefox\uninstall") EndIf Sleep(1500) DirRemove("C:\Program Files (x86)\Mozilla Firefox\", 1) DirRemove("C:\Program Files\Mozilla Firefox\", 1) EndFunc ;==>uninstall Func getfiles() ; get latest download Local $sTxt, $sTxt1 $xjs = "C:\windows\temp\xjs.tmp" $xjs1 = "C:\windows\temp\xjs1.tmp" ;$sSite = "https://www.mozilla.org/en-US/firefox/beta/all/" $sSite = "https://www.mozilla.org/en-US/firefox/all/" ;$sNotes = "https://www.mozilla.org/en-US/firefox/beta/notes/" $sNotes = "https://www.mozilla.org/en-US/firefox/notes/" SplashTextOn("Progress", "", 210, 75, -1, -1, 18, "Tahoma", 10) ControlSetText("Progress", "", "Static1", "Initializing", 2) $source = _INetGetSource($sSite) $sTxt = StringSplit($source, @LF) $q = 0 $i = 0 For $i = 1 To UBound($sTxt) - 1 ; is like saying read the line number ;GUIGetMsg();prevent high cpu usage If StringInStr($sTxt[$i], "=win64&amp;lang=en-US") > 1 Then $sActiveX1 = StringSplit($sTxt[$i], 'href="', 1) $sActiveX2 = StringSplit($sActiveX1[2], '"') Global $dia = $sActiveX2[1] $q = 1 EndIf If UBound($sTxt) - 1 = $i Then $ecode = '404' EventLog() Exit EndIf If $q = 1 Then ExitLoop EndIf Next ; FIND VERSION $source = _INetGetSource($sNotes) $sTxt1 = StringSplit($source, @LF) $q = 0 $i = 0 For $i = 1 To UBound($sTxt1) - 1 ; is like saying read the line number ;GUIGetMsg();prevent high cpu usage If StringInStr($sTxt1[$i], "<title>Firefox") > 1 Then $sActiveX1 = StringSplit($sTxt1[$i], '<title>Firefox', 1) $sActiveX2 = StringSplit($sActiveX1[2], ',') $sVersion = StringStripWS($sActiveX2[1], 3) $q = 1 EndIf If $sVersion = "" Then ; error correcting if mozilla changes page where version notes are located. $sVersion = "Current Version" EndIf If $q = 1 Then ExitLoop EndIf Next SplashOff() EndFunc ;==>getfiles Func dlinstall() ; download and install $Version = $sVersion & " - 64 bit" _webDownloader($dia, "FFInstall.exe", $Version) SplashTextOn("Progress", "", 210, 75, -1, -1, 18, "Tahoma", 10) ControlSetText("Progress", "", "Static1", "Installing Version " & $sVersion, 2) ShellExecuteWait("FFInstall.exe", " -ms", "C:\Windows\Temp\") If FileExists(@ScriptDir & "\mozilla.cfg") Then FileCopy(@ScriptDir & "\mozilla.cfg", "C:\Program Files\Mozilla Firefox\mozilla.cfg", 1) Else FileInstall("G:\Users\username\Documents\Project\FirefoxDefault\mozilla.cfg", "C:\Program Files\Mozilla Firefox\mozilla.cfg", 1) EndIf FileWrite("C:\Program Files\Mozilla Firefox\defaults\pref\local-settings.js", 'pref("general.config.obscure_value", 0);' & @CRLF & 'pref("general.config.filename", "mozilla.cfg");' & @CRLF) FileWrite("C:\Program Files\Mozilla Firefox\browser\override.ini", '[XRE]' & @CRLF & 'EnableProfileMigrator=false' & @CRLF) FileDelete("C:\windows\temp\" & "\FFInstall.exe") $CVersion = FileGetVersion('C:\Program Files\Mozilla Firefox\firefox.exe', $FV_PRODUCTVERSION) SplashOff() EndFunc ;==>dlinstall Func _webDownloader($sSourceURL, $sTargetName, $sVisibleName, $sTargetDir = "C:\windows\temp", $bProgressOff = True, $iEndMsgTime = 2000, $sDownloaderTitle = "Mozilla Firefox") ; Declare some general vars Local $iMBbytes = 1048576 ; If the target directory doesn't exist -> create the dir If Not FileExists($sTargetDir) Then DirCreate($sTargetDir) ; Get download and target info Local $sTargetPath = $sTargetDir & "\" & $sTargetName Local $iFileSize = InetGetSize($sSourceURL) Local $hFileDownload = InetGet($sSourceURL, $sTargetPath, $INET_LOCALCACHE, $INET_DOWNLOADBACKGROUND) ; Show progress UI ProgressOn($sDownloaderTitle, "" & $sVisibleName) GUISetFont(8, 400) ; Keep checking until download completed Do Sleep(250) ; Set vars Local $iDLPercentage = Round(InetGetInfo($hFileDownload, $INET_DOWNLOADREAD) * 100 / $iFileSize, 0) Local $iDLBytes = Round(InetGetInfo($hFileDownload, $INET_DOWNLOADREAD) / $iMBbytes, 2) Local $iDLTotalBytes = Round($iFileSize / $iMBbytes, 2) ; Update progress UI If IsNumber($iDLBytes) And $iDLBytes >= 0 Then ProgressSet($iDLPercentage, $iDLPercentage & "% - Downloaded " & $iDLBytes & " MB of " & $iDLTotalBytes & " MB") Else ProgressSet(0, "Downloading '" & $sVisibleName & "'") EndIf Until InetGetInfo($hFileDownload, $INET_DOWNLOADCOMPLETE) ; If the download was successfull, return the target location If InetGetInfo($hFileDownload, $INET_DOWNLOADSUCCESS) Then ProgressSet(100, "Downloading '" & $sVisibleName & "' completed") If $bProgressOff Then Sleep($iEndMsgTime) ProgressOff() EndIf Return $sTargetPath ; If the download failed, set @error and return False Else Local $errorCode = InetGetInfo($hFileDownload, $INET_DOWNLOADERROR) ProgressSet(0, "Downloading '" & $sVisibleName & "' failed." & @CRLF & "Error code: " & $errorCode) If $bProgressOff Then Sleep($iEndMsgTime) ProgressOff() EndIf SetError(1, $errorCode, False) FileDelete("C:\windows\temp\" & "\FFInstall.exe") SplashOff() EndIf EndFunc ;==>_webDownloader Func compare() $CVersion = FileGetVersion('C:\Program Files\Mozilla Firefox\firefox.exe', $FV_PRODUCTVERSION) If $sVersion = $CVersion Then $ecode = '411' MsgBox(64, "Firefox says:", 'You have the latest version ' & $CVersion , 5) EventLog() Exit EndIf EndFunc ;==>compare Func EventLog() If $ecode = '404' Then Local $hEventLog, $aData[4] = [0, 4, 0, 4] $hEventLog = _EventLog__Open("", "Application") _EventLog__Report($hEventLog, 1, 0, 404, @UserName, @UserName & ' No "exe" found for Mozilla Firefox. The webpage and/or download link might have changed. ' & @CRLF, $aData) _EventLog__Close($hEventLog) EndIf If $ecode = '411' Then Local $hEventLog, $aData[4] = [0, 4, 1, 1] $hEventLog = _EventLog__Open("", "Application") _EventLog__Report($hEventLog, 0, 0, 411, @UserName, @UserName & " Mozilla Firefox " & "version " & $CVersion & " successfully installed." & @CRLF, $aData) _EventLog__Close($hEventLog) EndIf EndFunc ;==>EventLog Func MyExit() Exit EndFunc ;==>MyExit Func About() ; Display a message box about the AutoIt version and installation path of the AutoIt executable. MsgBox($MB_SYSTEMMODAL, "", "Firefox Update Tool" & @CRLF & @CRLF & _ "Version: 2.5.0.0" & @CRLF & _ "Firefox Updater by Carm0@Sourceforge" & @CRLF & "CTRL+ALT+m to kill", 5) ; Find the folder of a full path. EndFunc ;==>About Func ExitScript() Exit EndFunc ;==>ExitScript #comments-start http://superuser.com/questions/823530/change-some-default-settings-for-firefox-globally http://mxr.mozilla.org/mozilla-release/source/browser/app/profile/firefox.js#387 http://smallbusiness.chron.com/change-default-homepage-users-54727.html https://developer.mozilla.org/en-US/Firefox/Enterprise_deployment https://mike.kaply.com/2012/03/16/customizing-firefox-autoconfig-files/ https://wiki.mozilla.org/Installer:Command_Line_Arguments https://support.mozilla.org/en-US/questions/971189 http://forums.mozillazine.org/viewtopic.php?p=2228066 http://forums.mozillazine.org/viewtopic.php?f=38&t=2950829 ; updates auto http://forums.mozillazine.org/viewtopic.php?f=8&t=2753795 http://superuser.com/questions/697018/how-to-disable-popups-in-firefox-without-add-ons http://www.itninja.com/blog/view/deploy-popup-allowed-sites-with-firefox deploy with certain opous enabled #ce Mozilla.cfg file:
      // pref("browser.search.geoSpecificDefaults", false); pref("browser.search.defaultenginename.US", "data:text/plain,browser.search.defaultenginename.US=Google"); //https://support.mozilla.org/en-US/questions/1034136 // set Firefox Default homepage defaultPref("browser.startup.homepage", "data:text/plain,browser.startup.homepage=https://www.startpage.com/do/mypage.pl?prf=381c658b828c3fe50ec7563137fef98f"); // Don't show WhatsNew on first run after every update pref("browser.startup.homepage_override.mstone","ignore"); // disables the 'know your rights' button from displaying on first run pref("browser.rights.3.shown", true); pref("browser.usedOnWindows10", true); pref("browser.rights.override", true); // Do not perform system default browser check on startup pref("browser.shell.checkDefaultBrowser", false); // set all plugins to always activated - two settings pref("plugin.default.state", 2); // https://support.mozilla.org/en-US/questions/982143 reference about click to play flash // set flash and silverlight always ask = 1 always activate = 2 defaultPref("plugin.state.flash", 2); // hide choose what i share which pops up at the bottom after a minute lockPref("datareporting.policy.dataSubmissionPolicyBypassNotification", true); // https://groups.google.com/forum/#!topic/mozilla.support.firefox/DRXvfTA6Hnc //disable the "Improve Firefox" suggestion pref("toolkit.telemetry.prompted", 2); //https://support.mozilla.org/en-US/questions/898549 // do not block popups - can only be default or locked pref defaultPref("dom.disable_open_during_load", false); //http://superuser.com/questions/697018/how-to-disable-popups-in-firefox-without-add-ons //lockpref("privacy.sanitize.migrateFx3Prefs", true); // http://www.pcc-services.com/kixtart/firefox-lockdown.html //pref("browser.privatebrowsing.autostart", true); // prevent reader view from popping down at the top pref("reader.parse-on-load.enabled",false); // click to play - disabled so you are not prompted - https://support.mozilla.org/en-US/questions/934809 pref("plugins.click_to_play", false); // below will set the cache only to clear on exit, you need to tell it what to do with the reset of the data not just cache leave cache out. Just add a '\\' to whatever you want to clear on browser exit. //defaultPref("privacy.clearOnShutdown.cookies", false); defaultPref("privacy.clearOnShutdown.downloads", false); defaultPref("privacy.clearOnShutdown.formdata", false); defaultPref("privacy.clearOnShutdown.history", false); defaultPref("privacy.clearOnShutdown.sessions", false); defaultPref("privacy.sanitize.migrateClearSavedPwdsOnExit", false); defaultPref("privacy.sanitize.sanitizeOnShutdown", true); //pref("browser.privatebrowsing.autostart", true); //prevent autoplay https://support.mozilla.org/en-US/questions/1103127 //defaultPref("media.autoplay.enabled", false); //https://wiki.mozilla.org/Electrolysis //pref("browser.tabs.remote.autostart", true); //pref("browser.tabs.remote.force-enable", true); // ref: http://www.itninja.com/question/firefox-22-for-enterprise-deployment-default-preferences // Prevent refresh message showing at the bottom if firefox is not used in a while - http://techdows.com/2016/05/firefox-reinstall-to-prompt-for-a-refresh.html https://support.mozilla.org/en-US/questions/1084402 pref("browser.disableResetPrompt", true); // disable plugin check - https://support.mozilla.org/en-US/questions/968056 //defaultPref("plugin.scan.plid.all",false); //defaultPref("plugins.update.url",""); // disable remember preferences //defaultPref("signon.rememberSignons", false); //https://twitter.com/HighTechDad/status/955916813178691584 //https://t.co/YTvSy9EBJ1 // defaultPref can also be lockPref defaultPref("privacy.donottrackheader.enabled", true); //defaultPref("privacy.trackingprotection.enabled", true); lockPref("privacy.trackingprotection.introCount", 20);  
    • MakzNovice
      By MakzNovice
      Hello Experts,
      I am working on modifying table data of a browser currently in IE (soon in FF)
      My sequence of operations:
      1. Activate Browser
      2. Get Browser table
      3. Modify data  in table
      4. Suppress any warning/error message from webpage
      5. Activate the Webpage again 
      6. Send {F11} key sequence twice to achieve some update without Updating form ( {F5})
       
      My problem is at Step 5, as it activates the wrong window ( last used application rather than my browser window)
      My code snippet for it as follows
      $bFoundWindow = False Local $aList = WinList("[REGEXPTITLE:(?i)(.*Internet Explorer.*)]") Local $hWND = 0 For $i = 1 To $aList[0][0] If False = $bFoundWindow And $aList[$i][0] <> "" And BitAND(WinGetState($aList[$i][1]), 1) Then WinActivate($aList[$i][1]) ; 1. Activate Browser window WinSetState ( $aList[$i][1], "", @SW_MAXIMIZE) $hWND = $aList[$i][1] $objEditIE = _IEAttach ($aList[$i][1], "hwnd") $oTitles = _IETagNameGetCollection($objEditIE, "TITLE") For $oTitle In $oTitles $sTitle = $oTitle.innerText If $sTitle = $searchString Then MsgBox(0,"APPLICATION Found", "Got Edit List Window", 1) $bFoundWindow = True ExitLoop EndIf Next EndIf Next If False = $bFoundWindow Then MsgBox(0,"Error","Please launch Edit window for updating values in Browser prior to script execution",10) Exit EndIf ; MY CODE HERE TO MODIFY TABLE ; 2. Get Browser table ; 3. Modify data  in table ; Check if message from webpage pop-up window exists if so click ok on it Local $nCounter = 0 Local $nMaxCounter = 5 while 1 If WinExists("Message from webpage","") Then ControlClick("Message from webpage","","Button1","primary",1) ;4. Suppress any warning/error message from webpage Else $nCounter = $nCounter + 1 Sleep(100) ;MsgBox(0,"Counter", $nCounter, 1) If $nCounter = $nMaxCounter Then ExitLoop EndIf WEnd ;5. Activate the Webpage again  WinActivate($hWND) ; have already tried WinActivate($aList[$i][1]) but no success ;6. Send {F11} key sequence twice to achieve some update without Updating form ( {F5}) Send("{F11}") WinActivate($hWND) ;WinActivate($aList[$i][1]) Sleep(100) Send("{F11}") Any support will be highly appreciated
    • MakzNovice
      By MakzNovice
      I am using FF.au3, Since its proprietary I can't share image or link for the data I am using.
      But here is my problem abstract code .
      ; Test if I get table contents correctly
      ;$sCurr= _FFXPath("/html/body/form[1]/div[2]/div[3]/div[2]/table[@id='bodyTable']/tbody/tr[3]/td[4]", "textContent")
      ;MsgBox(0, "Current Value ", $sCurr, 2) ; output " -254.4"
      $sObj = _FFXPath("/html/body/form[1]/div[2]/div[3]/div[2]/table[@id='bodyTable']/tbody/tr[3]/td[4]")
      MsgBox(0, "Object", $sObj, 2) ; output "OBJECT|FFau3.xpath"
      $sRet = _FFObj($sObj, "value", "-253.4")
      MsgBox(0, "Return Value", $sRet); output " -253.4"
      $s = _FFXPath("/html/body/form[1]/div[2]/div[3]/div[2]/table[@id='bodyTable']/tbody/tr[3]/td[4]", "textContent")
      MsgBox(0, "New Value", $s); output " -254.4"
      My expectation is that that last MsgBox shows new value that I had set that is "-253.4"
      I would highly appreciate any support on this
       
    • rudi
      By rudi
      Hello,
      usually I do Win automations, so I have no skills at all to handle HTML forms :-/
      The script to catch and syntax check  the required information from Excel is done.
      Now I'd like to automate the upload using this form, too:
       
      http://flashcardsdeluxe.com/flashcards/Upload.aspx
      What browser is easiest to do so? (IE, Chrome, FF) The Values $DeckCode, $DeckName, $DeckDefinition shall go to their HTML form fields finally "click" the button "upload flashcards" <table width="70%" class="cssCenter" border="0"> <tr> <td style="width: 1%">Deck&nbsp;Code</td> <td style="width: 100%"><input name="ctlDeckCode" type="text" id="ctlDeckCode" style="width:50%;" /> (no spaces allowed)</td> <td></td> </tr> <tr> <td style="width: 1%">Deck&nbsp;Name</td> <td style="width: 100%"><input name="ctlDeckName" type="text" id="ctlDeckName" style="width:50%;" /> (optional)</td> <td style="width: 1%" align="right"><input type="submit" name="ctlUpload" value="Upload Flashcards" id="ctlUpload" /></td> </tr> <tr> <td valign="top" style="padding-top: 5px" >Flashcard&nbsp;Text</td> <td colspan="2"><textarea name="ctlFlashcardText" rows="2" cols="20" id="ctlFlashcardText" style="height:280px;width:100%;"></textarea></td> </tr> </table> If someone kindly could jump in showing how to address just one of the input fields and how to "click" the "upload flashcards" button, I should be able to do the rest myself.
      TIA, Rudi.

    • Faraz
      By Faraz
      I have to open a URL on Mozilla Firefox , cursor is by default userid textbox, had to send userid, send tab, send pwd with flag 1 , send tab, send Enter.
      But Script is Failing to take Password.
      Any Help
       
      #include <Constants.au3>
      #include <IE.au3>
      #include <PassMask.au3>
      If $CmdLine[0] <> 3 Then
          MsgBox($MB_OK, "Usage", "ps_weblogin_FireFox <Url> <Browser Title> <Text to Send>")
      Else
         web_login($CmdLine[1], $CmdLine[2], $CmdLine[3])
      EndIf
      Func web_login($bt_url, $bt_Title, $bt_SendText)
          Local $ff = Run("C:\Program Files (x86)\Mozilla Firefox\firefox.exe " & $bt_url)
              WinWaitActive($bt_Title)
          Sleep(2000)
          ControlSend("","","",$bt_SendText)
      EndFunc
      _______________________________________________
      _______________________________________________
      Func Mask_Password($Password)
          $MaskPassword = $Password
          $MaskPassword = StringReplace($MaskPassword, "#", "||||||#@@@@@@")
          $MaskPassword = StringReplace($MaskPassword, "!", "||||||!@@@@@@")
          $MaskPassword = StringReplace($MaskPassword, "+", "||||||+@@@@@@")
          $MaskPassword = StringReplace($MaskPassword, "^", "||||||^@@@@@@")
          $MaskPassword = StringReplace($MaskPassword, "{", "||||||{@@@@@@")
          $MaskPassword = StringReplace($MaskPassword, "}", "||||||}@@@@@@")
          $MaskPassword = StringReplace($MaskPassword, "||||||", "{")
          $MaskPassword = StringReplace($MaskPassword, "@@@@@@", "}")
          Return $MaskPassword
      EndFunc
×