diff --git a/spec/driver_spec.rb b/spec/driver_spec.rb index 29ffbf7..433917a 100644 --- a/spec/driver_spec.rb +++ b/spec/driver_spec.rb @@ -177,6 +177,13 @@ describe Capybara::Driver::Webkit do end end + it "handles anchor tags" do + subject.visit("#test") + subject.find("//*[contains(., 'hello')]").should_not be_empty + subject.visit("#test") + subject.find("//*[contains(., 'hello')]").should_not be_empty + end + it "finds content after loading a URL" do subject.find("//*[contains(., 'hello')]").should_not be_empty end diff --git a/src/Visit.cpp b/src/Visit.cpp index b234047..ebf00de 100644 --- a/src/Visit.cpp +++ b/src/Visit.cpp @@ -8,11 +8,7 @@ Visit::Visit(WebPage *page, QObject *parent) : Command(page, parent) { void Visit::start(QStringList &arguments) { QUrl requestedUrl = QUrl(arguments[0]); - page()->currentFrame()->setUrl(QUrl(requestedUrl)); - if(requestedUrl.hasFragment()) { - // workaround for https://bugs.webkit.org/show_bug.cgi?id=32723 - page()->currentFrame()->setUrl(QUrl(requestedUrl)); - } + page()->currentFrame()->load(QUrl(requestedUrl)); } void Visit::loadFinished(bool success) {