Advertisement
Guest User

Untitled

a guest
Sep 26th, 2016
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.86 KB | None | 0 0
  1. class Extension
  2.  
  3. # In this example, we have two iframes. The one built into our extension directly,
  4. # and the one that renders our actual content.
  5. # We would need to jump through two frames to get to our extension code, and we
  6. # can also jump out to interact with the main webpage.
  7. enterInnerFrame: ->
  8.  
  9. # Enter our extension-provided iframe.
  10. @driver.wait(webdriver.until.elementLocated(css: @selectors.extensionFrame), 5000)
  11. @extensionFrame = @driver.findElement(css: @selectors.extensionFrame)
  12. @driver.switchTo().frame(@extensionFrame)
  13.  
  14. # Enter the iframe which hosts our actual content.
  15. @contentFrame = @driver.findElement(css: @selectors.contentFrame)
  16. @driver.switchTo().frame(@contentFrame)
  17.  
  18. # We can use this to jump back to our parent page. (LinkedIn, AngelList, etc.).
  19. enterRootFrame: ->
  20. @driver.switchTo().defaultContent()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement