Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Fixed switch-to-frame to use the native (java) frame object instead of the clojure wrapper #56

Closed
wants to merge 1 commit into from

2 participants

Sergey Didenko Daniel Gregoire
Sergey Didenko

No description provided.

Daniel Gregoire
Owner

Not sure what :webframe is referring to there. Could you explain what you're trying to accomplish in more detail?

Sergey Didenko

I use switch-to-frame in my code and it does not work without this patch.

The reason is that RemoteWebDriver.RemoteTargetLocator expects WebElement (see http://selenium.googlecode.com/svn/trunk/docs/api/java/org/openqa/selenium/WebDriver.TargetLocator.html)

The frame parameter passed into switch-to-frame is a clojure map that has WebElement in the :webframe key.

Sergey Didenko

I use it in the following way: "(switch-to-frame {:tag :frame :name "main"})". Is it wrong?

The documentation gives the following example of usage: "(switch-to-frame "#target-frame")"

Sergey Didenko

May be the better way would be to implement it like switch-to-window. By changing clj-webdriver.taxi/switch-to-frame to not wrap the frame-q into Element and clj-webdriver.core to contain cond.

Daniel Gregoire
Owner

Sorry I've taken so long to get into this, I don't often touch the frame-handling code.

I've fixed frame handling in the master branch for both the Core and Taxi API's, I suggest you look there for conformant code until I cut the next release (should be very soon).

I'm closing this out, but am still confused by your usage of :webframe, as that doesn't exist anywhere in the clj-webdriver API.

Daniel Gregoire semperos closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on May 30, 2012
  1. Sergey Didenko
This page is out of date. Refresh to see the latest.
Showing with 1 addition and 1 deletion.
  1. +1 −1  src/clj_webdriver/core_driver.clj
2  src/clj_webdriver/core_driver.clj
View
@@ -114,7 +114,7 @@
(doall (window-handles driver))))
(switch-to-frame [driver frame]
- (.frame (.switchTo (:webdriver driver)) frame)
+ (.frame (.switchTo (:webdriver driver)) (:webframe frame))
driver)
(switch-to-window [driver handle]
Something went wrong with that request. Please try again.