Code Monkey home page Code Monkey logo

Comments (15)

fsouza avatar fsouza commented on July 17, 2024

Closed by 28762a02ddf5ad23cd4f7f98dfa345eb0299df08.

from splinter.

gabrielfalcao avatar gabrielfalcao commented on July 17, 2024

cooool, hey @nyxtom checkout how cool are these splinter guys. They applied so fast :)
Kudos for @FranciscoSouza

from splinter.

nyxtom avatar nyxtom commented on July 17, 2024

Nice! that's awesome

from splinter.

fsouza avatar fsouza commented on July 17, 2024

Opened again, because we need docs :)

from splinter.

andrewsmedina avatar andrewsmedina commented on July 17, 2024

it needs a way to come back to main window

from splinter.

gabrielfalcao avatar gabrielfalcao commented on July 17, 2024

Maybe splinter could behave as "pushd" and "popd" shell commands:

browser.push_frame("frame_id1")
... do stuff for the iframe frame_id1
browser.push_frame("frame_foobar")
... do stuff for the iframe frame_foobar

browser.pop_frame()
... do EVEN MORE stuff for the iframe frame_id1
browser.pop_frame()
.... now we are back to main window

 -- Gabriel Falcão

2011/4/7 andrewsmedina
[email protected]:

it needs a way to come back to main window

Reply to this email directly or view it on GitHub:
#40 (comment)

from splinter.

nyxtom avatar nyxtom commented on July 17, 2024

Going back to the main window should be as simple as passing in the value of None. This is done in the selenium python driver code by default.

from splinter.

nyxtom avatar nyxtom commented on July 17, 2024

I've updated the documentation to reflect the changes with the latest pull request.

from splinter.

nyxtom avatar nyxtom commented on July 17, 2024

Gabriel, I like this idea of push/pop frame.

from splinter.

fsouza avatar fsouza commented on July 17, 2024

Hey, we're thinking about an API like this:

with browser.get_iframe('iframe_id') as iframe:
    element = iframe.find_element_by_id('element_id').first

or...

element = in_iframe('iframe_id').find_element_by_id('element_id').first

What do you think?

from splinter.

nyxtom avatar nyxtom commented on July 17, 2024

I like the first better because typically my tests are about switching to a frame and running a lot of interactions in that frame before I am done. The second use case means that I would be duplicating the in_iframe a lot. At least, that's my view on the matter.

from splinter.

andrewsmedina avatar andrewsmedina commented on July 17, 2024

in the first case you will be repeat iframe instead in_frame. I think that with in_frame you can do:

iframe = in_frame('iframe_id')
iframe.find_element_by_id('element_id').first
iframe.find_element_by_id('other_element_id').first

from splinter.

fsouza avatar fsouza commented on July 17, 2024

Just an adjust:

browser.in_frame('iframe_id')

instead of just

in_frame('iframe_id')

:)

from splinter.

douglascamata avatar douglascamata commented on July 17, 2024

with approach implemented.

with browser.get_iframe('iframe_id') as iframe:
    element = iframe.find_element_by_id('element_id').first

As Selenium only works with iframes changing the context of the driver, we can't implement something like Andrews's examples. I discussed with him and we'll maintain just the with way, because having to switch to a frame and switch back everytime it's so boring and not pythonic.

Closed.

from splinter.

dxq0126 avatar dxq0126 commented on July 17, 2024

so how can i go back to the parent window context?

from splinter.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.