MachinePublishers / jBrowserDriver

A programmable, embeddable web browser driver compatible with the Selenium WebDriver spec -- headless, WebKit-based, pure Java
Other
809 stars 143 forks source link

getCurrentUrl doesn't return hash, or value after hash #194

Open Jazzepi opened 7 years ago

Jazzepi commented 7 years ago

I'm not sure if this is a bug? I think it might be. I have code that if I view it in Chrome I can see it increment the hash location.

var counter = 0;
loop = function() {
    parent.location.hash = counter;
    counter++;
    if (counter < 10) {
        setTimeout(loop, 100);
    }
}
loop();

When I visit a webpage with that code and repeatedly call getCurrentUrl all I get is the part before the #. Is jBrowserDriver able to see this value in the URL? Is it getting dropped somewhere? Maybe my Javascript doesn't work correctly in jBrowserDriver? Is there a way to make the url bar appear in the driver when it's not in headless mode? I didn't see anything in the options that would allow that.