0

I am writing a java code using selenium webdriver to automate a web application. When the web application opens it gives me a browser pop-up to install a plugin that is required for the application but I have not been able to get anything on how to click on the pop-up since its browser generated. Need help!

Also every time, my application opens, the browser gives a pop-up which it shouldn't since the plugin for the application is already installed. Why does that happen?

Below is the code I have written till now. As soon as the setup button is clicked the pop up appears which I need to allow since it will install the plugin and then the next button needs to be clicked. (I have just started learning selenium so might have done some mistake, can help in rectifying it) Thank you

import org.openqa.selenium.Alert;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;

public class Test1 {
public static void main(String[] args) {
    // create a firefox web driver
    WebDriver driver = new FirefoxDriver();

    // open webpage
    driver.get("C:\\Users\\ajhavar.INOVATE\\Desktop\\Training_Docs\\Sample_WebAPI_Client\\ptt_Latest.html");
    //driver.get("http://www.indeed.com");

    //find setup button and click it
    driver.findElement(By.id("setup_web")).click();

    //Alert alert =driver.switchTo().alert();
    //alert.accept();


//find initializecall button and click it
    //driver.findElement(By.id("initializeCallBacksbutton")).click();
  • This is not possible (anything other than a standard alert box or basic auth prompt), as far as I know, without using Marionette. – djangofan Mar 25 '16 at 15:50
  • thank you. Can you tell me how to open my application in an opened browser in a new tab in that case it might not ask for the plugin install. – Aniruddh Jhavar Mar 25 '16 at 16:07
  • Is your goal to install plug-in before running test or to avoid being prompted for its installation? – timbre timbre Mar 25 '16 at 17:45
  • 1
    Possible duplicate of [How to add java plugin to firefox profile using selenium webdriver](http://stackoverflow.com/questions/20947659/how-to-add-java-plugin-to-firefox-profile-using-selenium-webdriver) – djangofan Mar 25 '16 at 20:56
  • The popup is (likely) a window. I would need to see the HTML. But [this](http://www.abodeqa.com/2013/09/12/handling-multiple-windows-in-selenium-webdriver/) should help. – MikeJRamsey56 Mar 25 '16 at 21:08
  • You need to install add-on before you started the browser: `File addOnFile = new File( addOnPath ); FirefoxProfile profile = new FirefoxProfile(); profile.addExtension( addOnFile ); WebDriver driver = new FirefoxDriver( profile );` – timbre timbre Mar 26 '16 at 02:15

0 Answers0