Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to click on "Launch Application" dialog in Firefox with Selenium?

I have a Selenium test, in which I need to click on a "cliclient://" link, and that link needs to open an application. Now, I need to create a new profile for each test, and I don't know how to bypass the "Launch Application" dialog that appears when clicking on the link:

enter image description here

Here's a snippet of the test that I've 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 set, to bypass the dialog, or to somehow click on OK when this dialog appears?

like image 988
Zoran Trifunovski Avatar asked Mar 21 '17 14:03

Zoran Trifunovski


People also ask

Can you tell me the syntax to open launch Firefox browser in WebDriver software testing tool?

WebDriver driver = new FirefoxDriver(); This is the java implementation of launching a browser in Selenium. Here, 'WebDriver' is an interface and we are creating a reference variable 'driver' of type WebDriver, instantiated using 'FireFoxDriver' class.

How do I run Selenium test in Firefox?

Step 1: Navigate to the official Selenium website. Under third-party drivers, one will find all the drivers. Just click on the Mozilla GeckoDriver documentation as shown below. Now, it will navigate to the GeckoDriver downloads link, where one can download the suitable driver based on the OS as it is platform agnostic.


1 Answers

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

Hovever to use it with ruby you will most probably need to compile and run a java class via a system command and also you will need JDK installed on the machine where the automation will be performed

like image 90
Inquisitive Avatar answered Jan 02 '23 12:01

Inquisitive