1

Actually I'm working on JSF web application that displays characteristics that influence speed website performance. Using Selenium I achieve this.

@Stateless
@LocalBean
public class OpenSite implements OpenSiteLocal {
 public void openSiteEjb(String id) {
        System.setProperty("webdriver.chrome.driver",
                "chromedriver.exe");

        WebDriver driver = new ChromeDriver(); // Open the Application

        driver.get("https://www.facebook.com");
driver.switchTo().frame(0);
        JavascriptExecutor js = (JavascriptExecutor) driver;
        }}

This is HTML page:

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
    <html xmlns="http://www.w3.org/1999/xhtml"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:p="http://primefaces.org/ui"
    xmlns:ui="http://java.sun.com/jsf/facelets"> 

    <h:head></h:head> 
    <h:body>
            <h:commandLink id="btn1" onclick="this.nextSibling.value=true"  action="#{openSiteBean.openSite()}"  >open site
            </h:commandLink>
    <div class="box">

  <iframe name="iframe1" id="IF1" height="600" width="400" ></iframe>
</div> 
    </h:body>
    </html>

With the code above Facebook page open in onother window. But what I want is to open it on the iframe.

Manel Chaabene
  • 187
  • 1
  • 3
  • 14
  • You can't open facebook in iframe, they prevent it. See http://stackoverflow.com/questions/9680215/load-facebook-into-an-iframe – timbre timbre Apr 14 '16 at 02:59

0 Answers0