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 in Selenium by Rishab
• 1,460 points
768 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 10 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
• 760 points
202 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,400 points
37 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 15 in Selenium by Raishul
126 views
0 votes
1 answer

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,050 points
259 views
0 votes
1 answer
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,130 points
628 views
0 votes
1 answer

How to use such xpath to find web elements

It's much simpler to use: #MyDiv123 > div.super or ...READ MORE

answered Jun 14, 2018 in Selenium by Samarpit
• 5,130 points
256 views
+1 vote
3 answers

sendKeys() not working in Selenium Webdriver

driver.findElement(By.xpath("//label[text()='User Name:']/following::div/input")).sendKeys("UserName",Keys.TAB); By using a comma you can ...READ MORE

answered Feb 7 in Selenium by Priyaj
• 56,160 points
10,522 views
0 votes
2 answers