Ask a Question
Ask Question Login
Corporate Training
  1. Community
  2. Cyber Security
  3. Question
Cyber Security

There was an error - compound class names not permitted, what should I do?

Asked by Anil Jha Feb 24, 2022 597 views 1 answer
Share

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?


Your answer

1 Answer

More Cyber Security discussions

Learn & Explore

Free tutorials and interview questions from industry experts — learn the skill, then get ready to prove it.

Latest Cyber Security Blogs

Guides, tips and career advice on Cyber Security from JanBask experts.