How to click the Launch Application dialog box in Firefox with Selenium?

I have a Selenium test in which I need to click the "cliclient: //" link, and this link should open the application. Now I need to create a new profile for each test, and I don’t know how to bypass the Run Application dialog box that appears when I click on the link:

enter image description here

Here is a snippet of the test I created:

profile = Selenium::WebDriver::Firefox::Profile.new profile.secure_ssl = false profile.assume_untrusted_certificate_issuer=true profile["plugin.default.state"] = 2 profile["plugin.state.java"] = 2 profile["browser.download.folderList"] = 2 profile["browser.download.manager.alertOnEXEOpen"] = false profile["browser.download.manager.closeWhenDone"] = true profile["browser.download.manager.focusWhenStarting"] = false profile["browser.download.manager.showWhenStarting"] = false profile["browser.helperApps.alwaysAsk.force"] = false profile["browser.helperApps.neverAsk.saveToDisk"] = 'application/x-msdownload,application/octet-stream, application/x-msdownload, application/exe, application/x-exe, application/dos-exe, vms/exe, application/x-winexe, application/msdos-windows, application/x-msdos-program' profile["gfx.direct2d.disabled"] = true profile["layers.acceleration.disabled"] = true 

What is it in the profile that I need to install, bypass the dialog box or somehow click on OK when this dialog box appears?

+5
source share
2 answers

You can also try using SikuliX http://sikulix.com/ , which is an automation software that uses images to recognize GUI elements that need certain actions to be performed

To use it with ruby, you will most likely have to compile and run the Java class using the system command, and you will also need the JDK installed on the machine where the automation will be performed.

+1
source

Use C # to access the Win32 API and find the window handle with the heading "Run application". You will need to use this as the window is controlled by the OS and therefore Selenium cannot interact with it. Then use the same API to click the cancel button (find its identification properties using WinSpy )

Sorry if this is not a complete answer, but I could not just comment, because at the moment I do not have enough reputation.

0
source

Source: https://habr.com/ru/post/1265741/


All Articles