Switching to an iFrame or frame inside a Webpage using Selenium and C#

We can easily switch to an iFrame or evena  normal frame inside any Webpage using the inbuilt commands we have with Selenium and C#

 

/*The below code should be executed only when you are on the page which has a
  otherwise it will display an error message*/

//Code to switch to Frame
Driver.SwitchTo().Frame(0);


//In the above code the number inside the frame " Frame(0) " indicates which frame 
you have to switch to

 

You may also like...