I agree, you cannot directly switch to a child frame. Also, make sure to switch to the defaultContent
(driver.switchTo.defaultContent
) every time you want to switch frame. With regard to your example, driver.switchTo().frame("mainFrame.0.child")
— this could also work, but you need to get rid of unnecessary quotation marks.