I want to insert a photo in a mail (gmail) by automation in Selenium. I can attach an photo, so that is no problem.
The problem is when i come to this screen and want to change to the Upload tab. I can't find the correct findElement-question.
I have tried these, but dont get it to work:
driver.findElement(By.name("Upload")).click();
driver.findElement(By.xpath("//textarea[@name='Upload']")).click();
To do that first switch to frame i.e
WebElement framename=driver.findElement(By.id("amtponuhel03"));
driver.switchTo().frame(frameElement);
Then pass xpath of upload element to upload
driver.findElement(By.xpath("//*[@id=':7']/div[.='Upload']"));
this should work