EdgeSwitchFrame


 

EdgeSwitchFrame>session_id,method,reference,result

 

Switches the browsing context of a session created by EdgeStart to the specified frame or iframe.


 

method can be one of

index

element

empty string or null

If method is index, reference should be a number representing the index of the frame, where zero is the first frame. 


 

If method is element, reference should be an element object (not ID) returned by EdgeFindElements.


 

If successul result will be zero and the browsing context will change to the selected frame. Subsequent Edge functions will act upon that frame.  


 

To return the context to the parent window leave method empty or use index with reference set to null.


 

See also: Edge Functions

 

Example

 

Let>EDGEDRIVER_EXE=c:\msedgedriver.exe


 

//start an Edge session

EdgeStart>session_id


 

//navigate to a page with a frame

EdgeNavigate>session_id,url,https://www.mjtnet.com/contact.htm


 

//Find the frame

EdgeFindElements>session_id,xpath,//iframe[@src='/contact-form/formpage.html'],elements


 

//switch to the first frame (the one with the fields)

EdgeSwitchFrame>session_id,element,elements_objects_1,res


 

//now anything we do is inside that frame so we should be able to get the name field and enter something

EdgeFindElements>session_id,id,name,inputs

EdgeSetElementValue>session_id,inputs_1,john doe


 

//Switch context back to parent

EdgeSwitchFrame>session_id,index,null,res