Quantcast
Channel: Active questions tagged selenium - Stack Overflow
Viewing all articles
Browse latest Browse all 99408

Python Selenium: Block-Title is not properly verified. (Magento Cloud)

$
0
0

Details:

Currently I am writing within a project based on Magento Cloud test cases with Python-Selenium. So far everything is fine. Currently I only have one problem, which I can't explain anymore.

Actually it's only about the verification of a text. Or the verification of a block title within a profile page.

I would like to secure multiple times, and thus define 2 different test cases.

issues

I always get the following message.

    selenium.common.exceptions.StaleElementReferenceException: Message: stale element reference: element is not attached to the page document
  (Session info: chrome=78.0.3904.108)

The Source

#Verify My Account
        driver.get("https:my-url.de")
        try: self.assertEqual("Account Information", driver.find_element_by_xpath("(.//*[normalize-space(text()) and normalize-space(.)='My Account'])[4]/following::strong[1]").text)
        except AssertionError as e: self.verificationErrors.append(str(e))
        self.assertEqual("Account Information", driver.find_element_by_xpath("(.//*[normalize-space(text()) and normalize-space(.)='My Account'])[4]/following::strong[1]").text)

Questions:

  • Do I use the correct query? Apparently no?
  • Is it due to Magento
  • How can I check these blocks?

    selenium.common.exceptions.StaleElementReferenceException: Message: stale element reference: element is not attached to the page document

enter image description here


Viewing all articles
Browse latest Browse all 99408

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>