Question

I am trying to accessing the url using gebish.

Browser homePageBrowser = new Browser(driver: new HtmlUnitDriver())
HomePage.url = "http://edition.cnn.com/"
homePageBrowser.with {
    to HomePage
    pageTitle = title
}

Here is the code of HomePage.groovy

class HomePage extends Page {
    static url = "http://edition.cnn.com/"
    static content = {
    title {
        $("title").text()
    }
}

I am not getting response from cnn.com where as if i visit site manually in the browser i am able to get.This is only happening for "http://edition.cnn.com". I am able to get response for remaining urls. Please help me to fix this problem

Était-ce utile?

La solution

Problem with that site is having meta refresh in the header tags. including driver.webClient.refreshHandler = new ThreadedRefreshHandler() this code solved my problem

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top