Packages

Elixir wrapper for selenium webdriver protocol

Retired package: Release invalid - no longer maintained

Current section

Files

Jump to
selenium lib commands iframe.ex
Raw

lib/commands/iframe.ex

defmodule Selenium.Commands.Iframe do
alias Selenium.Session
alias Selenium.Request
# Change focus to an iframe
def focus(identifier, id) do
session_id = Session.get(identifier)
{:ok, %HTTPoison.Response{body: body,
headers: _,
status_code: _}} = Request.post("session/#{session_id}/frame", %{"id" => id}, [], [recv_timeout: Application.get_env(:selenium, :timeout), hackney: [pool: :driver_pool]])
body
end
# Change focus to the parent frame
def parent(identifier) do
session_id = Session.get(identifier)
{:ok, %HTTPoison.Response{body: body,
headers: _,
status_code: _}} = Request.post("session/#{session_id}/frame/parent", "", [], [recv_timeout: Application.get_env(:selenium, :timeout), hackney: [pool: :driver_pool]])
body
end
end