Switching between iframes using selenium web driver python -


i have come across examples site , others on subject, still have problem figuring out do.

i trying switch between frames, , frame header looks this:

<iframe frameborder="0" id="mif-comp-ext-gen-top349-264685" name="mif-comp- ext-gen-top349-264685" src="/blah/blah/"  style="width: 838px; height: 822px;" title="display changes?"></iframe> 

the id mif-comp-ext-gen-top349-264685 keeps changing every page load not unique.

this have come doesn't work:

driver.switch_to.frame(driver.find_element_by_link_text("/blah/blah/")) 

this wrong because "/blah/blah/" src= not link.

how switch frame?

use name locator

driver.switch_to.frame(driver.find_element_by_name("mif-comp- ext-gen-top349-264685")); 

or xpath

 driver.switch_to.frame(driver.find_element_by_xpath("//iframe [@name='mif-comp-     ext-gen-top349-264685']")); 

Comments

Popular posts from this blog

ios - MKAnnotationView layer is not of expected type: MKLayer -

ZeroMQ on Windows, with Qt Creator -

unity3d - Unity SceneManager.LoadScene quits application -