About this question
The thing what I wanted to do was, write java code for automate the sending an email via gmail. When I try to locate element of send button it throws following errors. The code I used, is like this;
driver.findElement(By.id("r7")).click();
Error
Unable to locate element: {"method":"id","selector":"r7"}
Command duration or timeout: 30.11 seconds
I searched the reason for it. I found these using firebug.
Send
id is not static at every time of the send button. But class is same in every message window.
you can see it by looking at this (from firebug console) and previous one.
Send
Finally I tried this code,
driver.findElement(By.className("T-I J-J5-Ji aoO T-I-atl L3 T-I-JW")).click();
It gives this error,
The given selector T-I J-J5-Ji aoO T-I-atl L3 T-I-JW is either invalid or does not result in a WebElement. The following error occurred:
InvalidSelectorError: Compound class names not permitted
How can I fix this problem?