chudkins / DSF

A script to automate working with EFI's Digital StoreFront
GNU General Public License v3.0
0 stars 0 forks source link

Script crashes if initial URL load fails #29

Open chudkins opened 5 years ago

chudkins commented 5 years ago

Today Firefox started but didn't load the URL at all.

New-Object : Exception calling ".ctor" with "0" argument(s): "The HTTP request to the remote WebDriver server for URL
http://localhost:64968/session timed out after 60 seconds."
At C:\Program Files\WindowsPowerShell\Modules\Selenium\1.1\Selenium.psm1:18 char:19
+ ...   $Driver = New-Object -TypeName "OpenQA.Selenium.Firefox.FirefoxDriv ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [New-Object], MethodInvocationException
    + FullyQualifiedErrorId : ConstructorInvokedThrowException,Microsoft.PowerShell.Commands.NewObjectCommand

Entire script crashed as a result of not finding the login fields or anything else. Figure out how to handle this more gracefully.

chudkins commented 5 years ago

Try using new Load-Page function, which will try X number of times and then return False if loading failed.