I\'m trying to write a Selenium Testcase and started with the Selenium IDE in Firefox. The test is working quite fine there. Now I want to automate that test with Selenium Webdr
You can use findElement to get the frame webelement and have it used with the switchto() method.
driver.switchTo().frame(driver.findElement(By.xpath("iframe[contains(@name=pngNewCase1143241142570_IFrame)]")));
If you have some other attribute like src, you can try the below.
WebElement frame=driver.findElement(By.xpath("//iframe[@src='showNewClaimForm.action']");
driver.switchTo().frame(frame);