Compound class names not permitted

0 votes

I am trying to click on travel coupon section in coupondunia website after searching for Paytm and am getting an error:-

Exception in thread "main" org.openqa.selenium.InvalidSelectorException: invalid selector: Compound class names not permitted

Can someone help? Thank you in advance.

This is the code I am using:

driver.get("https://www.coupondunia.in/");
driver.findElement(By.id("header-search-input")).sendKeys("Paytm",Keys.ENTER);
Thread.sleep(3000);
driver.findElement(By.className("fa fa-angle-right filter-icon filter-dropdown-category")).click();

Jan 10, 2019 in Selenium by Rishab
• 1,490 points
6,799 views

1 answer to this question.

0 votes

Instead of using Class name you can use the xpath of the element it works fine for me.

driver.get("https://www.coupondunia.in/");
driver.findElement(By.id("header-search-input")).sendKeys("Paytm",Keys.ENTER);
Thread.sleep(3000);
driver.findElement(By.xpath("/html[1]/body[1]/div[8]/div[17]/div[1]/div[2]/div[2]/div[2]/ul[1]/li[3]")).click();

This will help.

answered Jan 11, 2019 by Fujistu

Related Questions In Selenium

0 votes
1 answer

errors when using class names locators. Getting compound classes are not supported

Pretty straight forward..If your class name includes ...READ MORE

answered May 29, 2018 in Selenium by sniffy_god
• 780 points
3,082 views
0 votes
1 answer

How to avoid Compound Class name error in Page Object?

Use a CSS selector instead: .country.name CSS selector is ...READ MORE

answered Jul 31, 2018 in Selenium by Meci Matt
• 9,460 points
1,200 views
0 votes
0 answers

How to hover element when action class is not working in my Selenium framework ?

When i am writing the code to ...READ MORE

Feb 16, 2019 in Selenium by Raishul
3,954 views
0 votes
2 answers

Finding WebDriver element with Class Name in java

The better way to handle this element ...READ MORE

answered Apr 10, 2018 in Selenium by nsv999
• 5,500 points
13,773 views
0 votes
2 answers

Problem while using InternetExplorerDriver in Selenium WebDriver

enable trusted connection  in internet explorer by ...READ MORE

answered Aug 31, 2020 in Selenium by Sri
• 3,190 points
9,188 views
0 votes
1 answer

Geo-location microphone camera pop up

To Allow or Block the notification, access using Selenium and you have to ...READ MORE

answered May 11, 2018 in Selenium by Samarpit
• 5,910 points
7,263 views
0 votes
2 answers

How to use such xpath to find web elements

xpath are two types. 1) Absolute XPath:    /html/b ...READ MORE

answered Sep 3, 2020 in Selenium by Sri
• 3,190 points
7,902 views
+2 votes
4 answers

sendKeys() not working in Selenium Webdriver

this work for me you should update your ...READ MORE

answered Aug 27, 2019 in Selenium by Afif
30,230 views
+1 vote
2 answers
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP