Question is not about sending mail...its about below logic | Selenium Forum
M
Posted on 13/01/2016
sir , its not about sending emails .

My question is very simple


code is :

driver.findElement(By.xpath("//div[@class='aoX']/div/table/tbody/tr/td[2]/div[2]/div")).sendKeys("This is a test mail");
driver.findElement(By.xpath("//div[@class='aoI']/table/tbody/tr/td[2]/form/div[3]/input")).sendKeys("Time Pass");

working fine.


if i write below line ( below above 2 lines)

driver.findElement(By.xpath("//div[@class='aoI']/table/tbody/tr/td[2]/form/div/table/tbody/tr/td[2]/div/div/textarea")).sendKeys("sheenamjain.919@gmail.com");



I am getting element not visible error

M
Replied on 13/01/2016

hi did you try the code i provided you?


M
Replied on 14/01/2016

Yes its working


But i don't want to send mails.

Please expalin


driver.findElement(By.xpath("//div[@class='aoX']/div/table/tbody/tr/td[2]/div[2]/div")).sendKeys("This is a test mail");
driver.findElement(By.xpath("//div[@class='aoI']/table/tbody/tr/td[2]/form/div[3]/input")).sendKeys("Time Pass");

working fine.


if i write below line ( below above 2 lines)

driver.findElement(By.xpath("//div[@class='aoI']/table/tbody/tr/td[2]/form/div/table/tbody/tr/td[2]/div/div/textarea")).sendKeys("sheenamjain.919@gmail.com");



Why I am getting element not visible error


M
Replied on 14/01/2016

If you look at the page source, you'll understand that almost all of theSELECT, DIV elements are faked and created from JavaScript, that is why [color=#FF0000:3an30dqu]webdriver cannot SEE them[/color:3an30dqu].


that is why gmail is very hard to automate.