Switch Between Frames In Java Using Webdriver

Multiple frames in an web application are now a days common. So to switch in between them we can use the below code
  1. WebElement frameElement = driver.findElement(By.id("frame-id"));  
  2. driver.switchTo().frame(frameElement);