Sunday, 7 September 2014

How to handle the https website in Selenium

By changing the settings of FirefoxProfile.

Sample code for https secured Connection:


package Testng;

import org.openqa.selenium.firefox.FirefoxDriver;

import org.openqa.selenium.firefox.FirefoxProfile;
import org.openqa.selenium.WebDriver;

public class HTTPSSecuredConnection {

           public static void main(String[] args){

                       FirefoxProfile profile = newFirefoxProfile();

                       profile.setAcceptUntrustedCertificates(false);

                       WebDriver driver = newFirefoxDriver(profile);

                       driver.get("https://184.106.253.74");

}

}

To know FAQ's in Interviews on Selenium Please  ClickHere
To know more on SQL Queries Required For Testers Please  ClickHere

No comments:

Post a Comment