diff --git a/src/vws_web_tools/__init__.py b/src/vws_web_tools/__init__.py index 6c9e88c7..1ab102bd 100644 --- a/src/vws_web_tools/__init__.py +++ b/src/vws_web_tools/__init__.py @@ -969,18 +969,16 @@ def get_license_details( ), ) - long_wait.until( + # Use the value the wait returned rather than reading the element + # again: the wait only returns a non-empty key, but a second read + # can land after a re-render and see an empty box. + license_key = long_wait.until( method=lambda d: d.find_element( by=By.CLASS_NAME, value="license-key-box", ).text.strip(), ) - license_key = driver.find_element( - by=By.CLASS_NAME, - value="license-key-box", - ).text.strip() - return { "license_name": license_name, "license_key": license_key,