Smartscreen causing Error when launching Selenium Browser - selenium-webdriver

When running an autoinstaller for Selenium and the proper driver version for chrome, I encountered an error that upon replacing the old driver and running a test launch of the browser, the program would get stuck and force excel to crash and reopen. The cause of the error was Smartscreen blocking the launch of the browser driver from the Selenium Folder in the background with no way to tell the operation it is safe.
Errors out in somewhere here after the print line. I suspect its either the Set or .get line however when I manually opened the driver and told the computer it was fine to run, the problem went away and Was unable to recreate it. This installer needs to be ran on any number of different computers and I would like to know if either A, there is a way to suspend the launch if it takes "X" amount of time to run or B, figure out a way to avoid having it happen all together.
Notes: These are company laptops so other programs, disabling Smartscreen, or other elevated privileges are more than likely disabled. Ive been lucky to get this far with installing Selenium
If x < 3 Then
Debug.Print "Chrome Driver Test, try " & x
On Error GoTo InstallOverride
Else
Call FixChromeDriver
On Error GoTo ErrorHandler
End If
Set driverTest = CreateObject("Selenium.ChromeDriver")
With driverTest
.AddArgument "--headless"
.Get "https://www.google.com"
.Quit
End With
Set driverTest = Nothing

Related

React Kiosk App keeps crashing on Chrome - Chrome not Responding

We have a Kiosk app which runs on Chrome Kiosk mode and is written in React JS. But for some of our Kiosk machines (All of our machines are Windows machines), it seems to be crashing regularly (Approx. %4 of the devices) without any user input or fixed time between crashes.
I reviewed the code several times but never found any background tasks running, or any reason for the Chrome to crash at all.
Because the crashes are irregular, I cannot connect to a problematic device and wait for it to crash for hours to debug the process. And because the app is automatically started via a VB script when Windows is started, the clients often "solve" the crashes by restarting the Kiosk machine, which is time consuming and leads to tons of complaints.
So my questions are;
Can I somehow force Chrome to restart, or lets say Go to first page in history if it crashes?
Can I catch errors globally without using ErrorBoundries in JavaScript (It is already implemented and is used for other things)
I tried using --remote-debugging-port=9222 to use Developer Tools, but I need to be connected to the machine and go to localhost:9222 port manually to use this and cannot afford to be connected to the device all the time. So is there a way to connect and use Developer Tools on 9222 port remotely?
I tried saving console logs to a file (using Chrome Command Line Arguments) but never saw any "Errors" on the list, so is there any arguments to help me save crash logs to a file to inspect them after the crash?
Thanks for all your help.

Keil UV5.23/24/25 crashes on a 2nd start of debug session on Emulator

I have encountered a problem with uVision and Hitex emulator (Tanto2) on a Win10 laptop (fresh install).
My initial setup was UV5.23, I updated to 5.24 and made tentative with 5.25 on Keil's request.
I have a dedicated SDK release for UV5.23, I switched to a new one for UV5.24.
Firmware emulator was reflashed when I was using SDK for UV5.23, and updated when moving to UV5.24
What I can do:
- start UV5, open my project,
- start a debug session on the emulator, load my project, make the first run and stop debug session.
Whatever the release I use, the problem appears when I want to start a second debug session on the emulator. Once I click on the Start Debug, UV5 crashes with this message:
"uVision IDE has stopped working
A problem caused the program to stop working correctly. Windows will ..."
I need to relaunch UV5 to run a new debug session.
The setup using Keil 5.23 and its dedicated SDK release was OK till the end of March.
Since the end of March, the Windows updates that have appeared are: KB4088776, KB4093110, KB4093112, KB890830, KB4099989.
I tried uninstalling KB4099989, but there was no change, the problem is still present.
Is there a link with these updates?
If someone encounters the same problem and was able to solve it, I hear you :-)
The same problem appears on the laptop of my colleague whereas it is working fine before the last Windows update.
Thank you in advance for your help.
This is because of the below issue. If there is a crash in application during dll unload, windows adds an entry in registry to ignore a future unload dll request. So if the application tries to load the dll again within the same session, then the application crashes.
As a workaround goto the below location in registry,
My Computer\HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers
and delete the unload registry path. Everytime if there is a new crash then the dll will be added back which needs to be removed.
[work around]
I also get crashes when entering debugger session, however I noticed that it occurs only if I click the debugger icon and then leave the pointer over that icon. I have never had it crash if I click and immediately move the pointer away.

Batch taskkill won't kill

Ok so I'm trying to end Comodo (free firewall service) so that I can install NVidia driver updates, and since I'm super lazy I want this all to be automatic whenever NVidia tries to update. After I want to reopen Comodo.
However I'm stuck on the first step since I have no idea on how to properly end Comodo, when I try taskkill it says:
ERROR: The process "cis.exe" with PID 6204 could not be terminated.
Reason: Element not found.
I'm new to batch and have no idea what this error message means since I can clearly see that "cis.exe" (which is Comodo) is running in the background at least and I can close it from the icon tray if I wanted to, and it spits out the same message when I try using "CisTray.exe".
Also any advice on where I should go for the next few parts would be greatly appreciated, thinking on using task scheduler to open the batch file when some kind of log or something is made by NVidia.

Windows service recovery - run a program wont work

How do i do this?
i've tried all i can think of.
Browsing for my .exe file i want to run.
run a bat file
writing forcedos.exe in program textbox and path to my bat file in command line parameters textbox
Why cant it just work with an normal exe?
and i know it should run a program because it can restart the service correctly.
EDIT
Application: test.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.Exception
This is my latest try to make it work.
the script has the code
Dim objShell
Set objShell = WScript.CreateObject( "WScript.Shell" )
objShell.Run("iexplore")
Set objShell = Nothing
Now the script opens internet explorer if i run the cmd command
wscript.exe "C:\asfh.vbs"
The "run a program" recovery option for when a service crashes runs the specified executable in the same way as the service, i.e., it runs in session 0 (and so is affected by session 0 isolation, see also related questions) and it runs with the same security context as the service.
This means that it can't interact directly with the user (you can display a GUI, but nobody will see it) but it also restricts what the executable or script can do. For example, some shell API functions will not work properly unless the user account has been interactively logged in at some point. In the example script you posted, the script itself is probably running, but is unable to launch Internet Explorer because IE is only designed to run in an interactive session.
Provided you restrict yourself to basic functionality, it should all work as expected. (There is no master list that I know of describing what functionality is safe to use in a service context, but it is usually easy to guess. You can resort to trial and error if necessary!)
Also note that as far as I know forcedos.exe is no longer present in modern versions of Windows. If you want to run a batch file, you can specify cmd.exe as the application and /c myscript.bat as the command line parameters.

DOS concatenated commands order of precedence

What is wrong with the code below, that is intended to only report something is done if it returns cleanly:
echo Other operations here & (echo Trying to launching Firefox & "%ProgramFiles(x64)%"\Mozilla\Firefox\Firefox.exe && echo Firefox has closed successfully) & echo More operations that should be done regardless here
I believe your syntax is correct, but your expectations are wrong.
You are launching a Windowed application - your command will not wait for Firefox to close before it carries on. Your code is probably properly reporting that Firefox was started. Only if Firefox fails to start (perhaps it doesn't exist on the machine), only then will your conditional code be bypassed.
Normally, if you want to launch a Windowed application and wait for it to finish (close) before continuing, then you would use START /WAIT.
echo previous command & (start /wait "" yourApp.exe && echo successful closure) & echo additional commmands
However, I'm not sure that will work with a browser like Firefox. Many browsers consist of multiple executables. The launching executable may launch auxiliary procsses and then shut down. Your command would happily report that the launching exe returned with success, even though the browser would still be running. Again, I'm not sure if Firefox behaves like this. But if it does, then the problem becomes much more difficult. You would have to run a process that polls to see if Firefox is still active.
Sorry guys, this syntax works, there was other issues with the surrounding code that I didn't realise. Don't suppose anyone knows of a better way to debug DOS "scripting", it's almost as bad as VBS error messages!

Resources