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

" Selenium Compound class names not permitted "

Asked by Lucas Tucker Jul 15, 2021 3.5K views 1 answer
Share

About this question

I have the below code that clicks on an element to pop up a screen and copy the text in it

el1 = driver.find_element_by_id("keyDev-A")
el1.click()
el2 = driver.find_element_by_class_name("content")
print(el2.text)

However, when I tried to get selenium to click on the button within that popup with

el3 = driver.find_element(By.CLASS_NAME, "action-btn cancel alert-display")
el3.click()

It produces an error message: invalid selector: Compound class names not permitted

This is the HTML that I am trying to get selenium to click on. The Close button.

How should I be writing el3 in order to click on the close button?

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.