This is my code, where After clicking on attachment symbol it’s not taking the path and eclipse is not showing any error. Please help me how to resolve this.
// compose button //div[@class='T-I T-I-KE L3'] //div[@class='z0'] driver.findElement(By.xpath("//div[@class='z0']")).click();
// to maximize the compose window //img[@id=":mo"]
driver.findElement(By.xpath("//img[@id=":mo"]")).click();
// To address //input[@id=":ta"]
driver.findElement(By.xpath("//input[@id=":ta"]")).sendKeys("[email protected]");
// Subject //input[@name='subjectbox']
driver.findElement(By.xpath("//input[@name='subjectbox']")).sendKeys("Automation test");
// Body to write //div[@id=':qy']
driver.findElement(By.xpath("//div[@id=':qy']")).sendKeys("Hi, This is an Automated Script.. Thank you");
Thread.sleep(3000);
String path = "D:\Selenium\SeleniumLogo.png";
WebElement attachment = driver.findElement(By.xpath("//*[@id=":rc"]"));
attachment.sendKeys(path);
attachment.click();
driver.manage().timeouts().implicitlyWait(Duration.ofSeconds(20));
// send button //div[@id=":pe"]
driver.findElement(By.xpath("//div[@id=":pe"]")).click();[where After clicking on attachment symbol it's not taking the path and eclipse is not showing any error](https://i.sstatic.net/V0bLNMzt.png)
I have tried to send an attachment using xpath where, it found out the webelement of attachment symbol but didn’t take the path.
And in the eclipse it’s not even showing the error as attached in the screenshot.
Please help me how to resolve this. I am a fresher.
Jyotsna Bhakale is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.