UFT won't advance to the next line when a Windows security pop-up is present

119 views Asked by At

I need to open a .bat file that's on the network drive. When UFT Developer opens it, a security window pops up "We can't verify who created this file. Are you sure you want to run this file?" I've added an if statement to click Run when this pops up but UFT never gets to that line. When this window pops up, UFT stops working until someone manually clicks Run or Cancel. So in the below code snippet, it never gets past SystemUtil.Run line. I can't even pause or stop UFT when this window is up.

Besides changing security settings (which I don't want to), is there a way to make this work or do I have to find a different way to open the bat file?

SystemUtil.Run networkFilePath
If Window("Gate Folder").Dialog("Open File - Security Warning").Exist(3) Then
    Window("Gate Folder").Dialog("Open File - Security Warning").WinButton("&Run").Click
End If

For extra info, I'm accessing UFT on a VM with RDP. This pop up only shows up when running the file from the network drive, not when running it locally, but ideally, I'd rather keep the file on the network so any user could run it without having to download the file to their vm.

1

There are 1 answers

0
Kamiccola On

I was able to figure out how to avoid using the batch file altogether. I replaced the networkFilePath with the contents of the batch file (which had a local directory of a javaws.exe and an url of the .jnlp file). This runs it locally and doesn't trigger the Windows security pop-up.