Electron microscopy
 
driver.switch_to().parent_frame()
- Integrated Circuits -
- An Online Book -
Integrated Circuits                                                                                   http://www.globalsino.com/ICs/        


Chapter/Index: Introduction | A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z | Appendix

=================================================================================

.switch_to().

driver.switch_to().parent_frame() sets the current browsing context for future commands to the parent of the current browsing context. If the current context is the top level browsing context, the context remains unchanged. This will pass the control to the imminent parent frame of the current frame.

However, default_content() method selects either the first frame on the page, or the main document when a page contains iframes. This will pass the control to the main document which contains the iframes.

For instance, when we have:
         main body
               {
                  frame1
                         {
                            frame2
                                  {
                                      frame3 (here currently)
                                 }
                          }
                }
Then, driver.switch_to().default_content() will pass the control to main body, while driver.switch_to().parent_frrame() will pass the control to frame2.

============================================

Dropdown selection with frame index (note: frame(1) with index 1 is named as "frame2"): code:             
         Switch_to function and alert popup window         
Frames on the webpage (note: frame(1) with index 1 is named as "frame2"):
         Switch_to function and alert popup window
Output:
         Switch_to function and alert popup window

         
         
         
         
         
         
         
         
         
         
         
         
         
         
         
         
         
         

 

 

 

 

 

 

 

 

 

 

=================================================================================