Ask a Question
Ask Question Login
Corporate Training
  1. Community
  2. QA Testing
  3. Question
QA Testing

How can I resolve this error - compound class names not permitted?

Asked by Ankur Dwivedi May 6, 2022 2.1K views 1 answer
Share

About this question

Software Quality Assurance & Testing

Selenium vba XPath/css Element not found for

Asked 1 year, 11 months ago

Active 1 year, 11 months ago

Viewed 2k times

-1 I need help!

I'm trying to connect to this Webpage and interact with it via WebDriver. I managed to open the page but when I'm trying to interact I get this error. I tried to press this Link/Button which has the class "afpaas-quick-link ng-scope afpaas-condition-mobile-display"

and this was my code:

b = "afpaas-quick-link ng-scope afpaas-condition-mobile-display"

'obj.FindElementByClass(b).Click

Here I get the error "compound class names not permitted" so I checked google and the answer was Xpath/Css

I was able to get the CSS/Xpath via Chrome Inspector. Here are the two paths

body > div > div.afpaas-body > div > div.afpaas-sidebar.afpaas-sidebar--hide > div.afpaas-quick-links-container > div > a:nth-child(2)
'/html/body/div/div[3]/div/div[1]/div[3]/div/a[2]
I tried both but I get the error No Such Element found.... Why? What am I doing wrong?

The code I tried is

obj.FindElementByCss("body > div > div.afpaas-body > div > div.afpaas-sidebar.afpaas-sidebar--hide > div.afpaas-quick-links-container > div > a:nth-child(2)").Click

obj.FindElementByXPath("/html/body/div/div[3]/div/div[1]/div[3]/div/a[2]").Click Here is more of the page code Schnellzugriff Neue Überwei

<!-- end ngRepeat: quickLink in quickLinkItem.quickLinks -->

Your answer

1 Answer

More QA Testing discussions

Learn & Explore

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

Latest QA Testing Blogs

Guides, tips and career advice on QA Testing from JanBask experts.