Review `Handle Alert when popup window closes` test
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Anfängerfreundlichkeit
- 28/100
- Issue-Typ
- Bug
- Klarheit
- Muss geklärt werden
- Aktivitätsstatus
- Veraltet
- Tech-Stack
- python
- Bereich
- testing-qa
Rechercherichtung
Beginne mit dem Abnahmetest „Handle Alert when popup window closes“ und vergleiche die erfolgreichen und fehlgeschlagenen Logs des verknüpften GitHub Actions-Laufs. Untersuche anschließend die Pfade zur Alert-Behandlung in src/SeleniumLibrary/keywords/alert.py, insbesondere _handle_alert und _wait_alert; fertig ist die Arbeit, wenn der Test konsistente, nachvollziehbare Ergebnisse liefert, ohne dass der gemeldete Fenster- oder Alert-Fehler auftritt.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
In running the acceptance test for a recent pull request we received varying results on the Handle Alert when popup window closes test case.
When it fails the following trace loglevel is shown
<html>
<body>
<!--StartFragment-->
10:22:53.373 | INFO | HANDLE::<class 'datetime.timedelta'>::0:00:10 |
-- | -- | -- | --
<!--EndFragment-->
</body>
</html>10:22:53.373 INFO HANDLE::<class 'datetime.timedelta'>::0:00:10
10:22:53.373 DEBUG GET http://localhost:46269/session/59f81e650237aeb4b439252651ba8358/alert/text {}
10:22:53.379 DEBUG http://localhost:46269/ "GET /session/59f81e650237aeb4b439252651ba8358/alert/text HTTP/1.1" 404 747
10:22:53.380 DEBUG Remote response: status=404 | data={"value":{"error":"no such alert","message":"no such alert\n (Session info: headless chrome=112.0.5615.165)","stacktrace":"#0 0x55f5ce88dfe3 \u003Cunknown>\n#1 0x55f5ce5ccbc1 \u003Cunknown>\n#2 0x55f5ce5c0b41 \u003Cunknown>\n#3 0x55f5ce5e4279 \u003Cunknown>\n#4 0x55f5ce62a91b \u003Cunknown>\n#5 0x55f5ce5e40ee \u003Cunknown>\n#6 0x55f5ce62a693 \u003Cunknown>\n#7 0x55f5ce5fd03a \u003Cunknown>\n#8 0x55f5ce5fe17e \u003Cunknown>\n#9 0x55f5ce84fdbd \u003Cunknown>\n#10 0x55f5ce853c6c \u003Cunknown>\n#11 0x55f5ce85d4b0 \u003Cunknown>\n#12 0x55f5ce854d63 \u003Cunknown>\n#13 0x55f5ce827c35 \u003Cunknown>\n#14 0x55f5ce878138 \u003Cunknown>\n#15 0x55f5ce8782c7 \u003Cunknown>\n#16 0x55f5ce886093 \u003Cunknown>\n#17 0x7fec88957b43 \u003Cunknown>\n"}} | headers=HTTPHeaderDict({'Content-Length': '747', 'Content-Type': 'application/json; charset=utf-8', 'cache-control': 'no-cache'})
10:22:53.380 DEBUG Finished Request
10:22:53.881 DEBUG GET http://localhost:46269/session/59f81e650237aeb4b439252651ba8358/alert/text {}
10:22:53.893 DEBUG http://localhost:46269/ "GET /session/59f81e650237aeb4b439252651ba8358/alert/text HTTP/1.1" 200 14
10:22:53.894 DEBUG Remote response: status=200 | data={"value":null} | headers=HTTPHeaderDict({'Content-Length': '14', 'Content-Type': 'application/json; charset=utf-8', 'cache-control': 'no-cache'})
10:22:53.895 DEBUG Finished Request
10:22:53.895 DEBUG GET http://localhost:46269/session/59f81e650237aeb4b439252651ba8358/alert/text {}
10:22:53.897 DEBUG http://localhost:46269/ "GET /session/59f81e650237aeb4b439252651ba8358/alert/text HTTP/1.1" 404 784
10:22:53.898 DEBUG Remote response: status=404 | data={"value":{"error":"no such window","message":"no such window: target window already closed\nfrom unknown error: web view not found\n (Session info: headless chrome=112.0.5615.165)","stacktrace":"#0 0x55f5ce88dfe3 \u003Cunknown>\n#1 0x55f5ce5ccd36 \u003Cunknown>\n#2 0x55f5ce5a7b2c \u003Cunknown>\n#3 0x55f5ce62f83f \u003Cunknown>\n#4 0x55f5ce5e3ed1 \u003Cunknown>\n#5 0x55f5ce62a693 \u003Cunknown>\n#6 0x55f5ce5fd03a \u003Cunknown>\n#7 0x55f5ce5fe17e \u003Cunknown>\n#8 0x55f5ce84fdbd \u003Cunknown>\n#9 0x55f5ce853c6c \u003Cunknown>\n#10 0x55f5ce85d4b0 \u003Cunknown>\n#11 0x55f5ce854d63 \u003Cunknown>\n#12 0x55f5ce827c35 \u003Cunknown>\n#13 0x55f5ce878138 \u003Cunknown>\n#14 0x55f5ce8782c7 \u003Cunknown>\n#15 0x55f5ce886093 \u003Cunknown>\n#16 0x7fec88957b43 \u003Cunknown>\n"}} | headers=HTTPHeaderDict({'Content-Length': '784', 'Content-Type': 'application/json; charset=utf-8', 'cache-control': 'no-cache'})
10:22:53.898 DEBUG Finished Request
10:22:53.898 FAIL NoSuchWindowException: Message: no such window: target window already closed
from unknown error: web view not found
(Session info: headless chrome=112.0.5615.165)
Stacktrace:
#0 0x55f5ce88dfe3 <unknown>
#1 0x55f5ce5ccd36 <unknown>
#2 0x55f5ce5a7b2c <unknown>
#3 0x55f5ce62f83f <unknown>
#4 0x55f5ce5e3ed1 <unknown>
#5 0x55f5ce62a693 <unknown>
#6 0x55f5ce5fd03a <unknown>
#7 0x55f5ce5fe17e <unknown>
#8 0x55f5ce84fdbd <unknown>
#9 0x55f5ce853c6c <unknown>
#10 0x55f5ce85d4b0 <unknown>
#11 0x55f5ce854d63 <unknown>
#12 0x55f5ce827c35 <unknown>
#13 0x55f5ce878138 <unknown>
#14 0x55f5ce8782c7 <unknown>
#15 0x55f5ce886093 <unknown>
#16 0x7fec88957b43 <unknown>
10:22:53.899 DEBUG Traceback (most recent call last):
File "/home/runner/work/SeleniumLibrary/SeleniumLibrary/src/SeleniumLibrary/__init__.py", line 513, in run_keyword
return DynamicCore.run_keyword(self, name, args, kwargs)
File "/opt/hostedtoolcache/PyPy/3.7.13/x64/site-packages/robotlibcore.py", line 122, in run_keyword
return self.keywords[name](*args, **(kwargs or {}))
File "/home/runner/work/SeleniumLibrary/SeleniumLibrary/src/SeleniumLibrary/keywords/alert.py", line 131, in handle_alert
return self._handle_alert(alert, action)
File "/home/runner/work/SeleniumLibrary/SeleniumLibrary/src/SeleniumLibrary/keywords/alert.py", line 135, in _handle_alert
text = " ".join(alert.text.splitlines())
File "/opt/hostedtoolcache/PyPy/3.7.13/x64/site-packages/selenium/webdriver/common/alert.py", line 59, in text
return self.driver.execute(Command.W3C_GET_ALERT_TEXT)["value"]
File "/home/runner/work/SeleniumLibrary/SeleniumLibrary/src/SeleniumLibrary/keywords/browsermanagement.py", line 773, in execute
result = self._base_execute(driver_command, params)
File "/opt/hostedtoolcache/PyPy/3.7.13/x64/site-packages/selenium/webdriver/remote/webdriver.py", line 440, in execute
self.error_handler.check_response(response)
File "/opt/hostedtoolcache/PyPy/3.7.13/x64/site-packages/selenium/webdriver/remote/errorhandler.py", line 245, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.NoSuchWindowException: Message: no such window: target window already closed
from unknown error: web view not found
(Session info: headless chrome=112.0.5615.165)
Stacktrace:
#0 0x55f5ce88dfe3 <unknown>
#1 0x55f5ce5ccd36 <unknown>
#2 0x55f5ce5a7b2c <unknown>
#3 0x55f5ce62f83f <unknown>
#4 0x55f5ce5e3ed1 <unknown>
#5 0x55f5ce62a693 <unknown>
#6 0x55f5ce5fd03a <unknown>
#7 0x55f5ce5fe17e <unknown>
#8 0x55f5ce84fdbd <unknown>
#9 0x55f5ce853c6c <unknown>
#10 0x55f5ce85d4b0 <unknown>
#11 0x55f5ce854d63 <unknown>
#12 0x55f5ce827c35 <unknown>
#13 0x55f5ce878138 <unknown>
#14 0x55f5ce8782c7 <unknown>
#15 0x55f5ce886093 <unknown>
#16 0x7fec88957b43 <unknown>
Where as when it pass we got the following
<html>
<body>
<!--StartFragment-->
Documentation: | Handles the current alert and returns its message.
-- | --
20230427 10:22:12.459 / 20230427 10:22:12.985 / 00:00:00.526
<!--EndFragment-->
</body>
</html>Documentation:
Handles the current alert and returns its message.
Start / End / Elapsed: 20230427 10:22:12.459 / 20230427 10:22:12.985 / 00:00:00.526
10:22:12.460 INFO HANDLE::<class 'datetime.timedelta'>::0:00:10
10:22:12.460 DEBUG GET http://localhost:46113/session/6bb6f29b435dcee71c2cb55ece3f2689/alert/text {}
10:22:12.475 DEBUG http://localhost:46113/ "GET /session/6bb6f29b435dcee71c2cb55ece3f2689/alert/text HTTP/1.1" 404 747
10:22:12.476 DEBUG Remote response: status=404 | data={"value":{"error":"no such alert","message":"no such alert\n (Session info: headless chrome=112.0.5615.165)","stacktrace":"#0 0x556abadcdfe3 \u003Cunknown>\n#1 0x556abab0cbc1 \u003Cunknown>\n#2 0x556abab00b41 \u003Cunknown>\n#3 0x556abab24279 \u003Cunknown>\n#4 0x556abab6a91b \u003Cunknown>\n#5 0x556abab240ee \u003Cunknown>\n#6 0x556abab6a693 \u003Cunknown>\n#7 0x556abab3d03a \u003Cunknown>\n#8 0x556abab3e17e \u003Cunknown>\n#9 0x556abad8fdbd \u003Cunknown>\n#10 0x556abad93c6c \u003Cunknown>\n#11 0x556abad9d4b0 \u003Cunknown>\n#12 0x556abad94d63 \u003Cunknown>\n#13 0x556abad67c35 \u003Cunknown>\n#14 0x556abadb8138 \u003Cunknown>\n#15 0x556abadb82c7 \u003Cunknown>\n#16 0x556abadc6093 \u003Cunknown>\n#17 0x7f82165beb43 \u003Cunknown>\n"}} | headers=HTTPHeaderDict({'Content-Length': '747', 'Content-Type': 'application/json; charset=utf-8', 'cache-control': 'no-cache'})
10:22:12.476 DEBUG Finished Request
10:22:12.977 DEBUG GET http://localhost:46113/session/6bb6f29b435dcee71c2cb55ece3f2689/alert/text {}
10:22:12.981 DEBUG http://localhost:46113/ "GET /session/6bb6f29b435dcee71c2cb55ece3f2689/alert/text HTTP/1.1" 404 784
10:22:12.982 DEBUG Remote response: status=404 | data={"value":{"error":"no such window","message":"no such window: target window already closed\nfrom unknown error: web view not found\n (Session info: headless chrome=112.0.5615.165)","stacktrace":"#0 0x556abadcdfe3 \u003Cunknown>\n#1 0x556abab0cd36 \u003Cunknown>\n#2 0x556abaae7b2c \u003Cunknown>\n#3 0x556abab6f83f \u003Cunknown>\n#4 0x556abab23ed1 \u003Cunknown>\n#5 0x556abab6a693 \u003Cunknown>\n#6 0x556abab3d03a \u003Cunknown>\n#7 0x556abab3e17e \u003Cunknown>\n#8 0x556abad8fdbd \u003Cunknown>\n#9 0x556abad93c6c \u003Cunknown>\n#10 0x556abad9d4b0 \u003Cunknown>\n#11 0x556abad94d63 \u003Cunknown>\n#12 0x556abad67c35 \u003Cunknown>\n#13 0x556abadb8138 \u003Cunknown>\n#14 0x556abadb82c7 \u003Cunknown>\n#15 0x556abadc6093 \u003Cunknown>\n#16 0x7f82165beb43 \u003Cunknown>\n"}} | headers=HTTPHeaderDict({'Content-Length': '784', 'Content-Type': 'application/json; charset=utf-8', 'cache-control': 'no-cache'})
10:22:12.982 DEBUG Finished Request
10:22:12.983 FAIL An exception occurred waiting for alert: Message: no such window: target window already closed
from unknown error: web view not found
(Session info: headless chrome=112.0.5615.165)
Stacktrace:
#0 0x556abadcdfe3 <unknown>
#1 0x556abab0cd36 <unknown>
#2 0x556abaae7b2c <unknown>
#3 0x556abab6f83f <unknown>
#4 0x556abab23ed1 <unknown>
#5 0x556abab6a693 <unknown>
#6 0x556abab3d03a <unknown>
#7 0x556abab3e17e <unknown>
#8 0x556abad8fdbd <unknown>
#9 0x556abad93c6c <unknown>
#10 0x556abad9d4b0 <unknown>
#11 0x556abad94d63 <unknown>
#12 0x556abad67c35 <unknown>
#13 0x556abadb8138 <unknown>
#14 0x556abadb82c7 <unknown>
#15 0x556abadc6093 <unknown>
#16 0x7f82165beb43 <unknown>
10:22:12.985 DEBUG Traceback (most recent call last):
File "/home/runner/work/SeleniumLibrary/SeleniumLibrary/src/SeleniumLibrary/keywords/alert.py", line 148, in _wait_alert
return wait.until(EC.alert_is_present())
File "/opt/hostedtoolcache/PyPy/3.7.13/x64/site-packages/selenium/webdriver/support/wait.py", line 86, in until
value = method(self._driver)
File "/opt/hostedtoolcache/PyPy/3.7.13/x64/site-packages/selenium/webdriver/support/expected_conditions.py", line 439, in _predicate
return driver.switch_to.alert
File "/opt/hostedtoolcache/PyPy/3.7.13/x64/site-packages/selenium/webdriver/remote/switch_to.py", line 55, in alert
_ = alert.text
File "/opt/hostedtoolcache/PyPy/3.7.13/x64/site-packages/selenium/webdriver/common/alert.py", line 59, in text
return self.driver.execute(Command.W3C_GET_ALERT_TEXT)["value"]
File "/home/runner/work/SeleniumLibrary/SeleniumLibrary/src/SeleniumLibrary/keywords/browsermanagement.py", line 773, in execute
result = self._base_execute(driver_command, params)
File "/opt/hostedtoolcache/PyPy/3.7.13/x64/site-packages/selenium/webdriver/remote/webdriver.py", line 440, in execute
self.error_handler.check_response(response)
File "/opt/hostedtoolcache/PyPy/3.7.13/x64/site-packages/selenium/webdriver/remote/errorhandler.py", line 245, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.NoSuchWindowException: Message: no such window: target window already closed
from unknown error: web view not found
(Session info: headless chrome=112.0.5615.165)
Stacktrace:
#0 0x556abadcdfe3 <unknown>
#1 0x556abab0cd36 <unknown>
#2 0x556abaae7b2c <unknown>
#3 0x556abab6f83f <unknown>
#4 0x556abab23ed1 <unknown>
#5 0x556abab6a693 <unknown>
#6 0x556abab3d03a <unknown>
#7 0x556abab3e17e <unknown>
#8 0x556abad8fdbd <unknown>
#9 0x556abad93c6c <unknown>
#10 0x556abad9d4b0 <unknown>
#11 0x556abad94d63 <unknown>
#12 0x556abad67c35 <unknown>
#13 0x556abadb8138 <unknown>
#14 0x556abadb82c7 <unknown>
#15 0x556abadc6093 <unknown>
#16 0x7f82165beb43 <unknown>
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/runner/work/SeleniumLibrary/SeleniumLibrary/src/SeleniumLibrary/__init__.py", line 513, in run_keyword
return DynamicCore.run_keyword(self, name, args, kwargs)
File "/opt/hostedtoolcache/PyPy/3.7.13/x64/site-packages/robotlibcore.py", line 122, in run_keyword
return self.keywords[name](*args, **(kwargs or {}))
File "/home/runner/work/SeleniumLibrary/SeleniumLibrary/src/SeleniumLibrary/keywords/alert.py", line 130, in handle_alert
alert = self._wait_alert(timeout)
File "/home/runner/work/SeleniumLibrary/SeleniumLibrary/src/SeleniumLibrary/keywords/alert.py", line 152, in _wait_alert
raise AssertionError(f"An exception occurred waiting for alert: {err}")
AssertionError: An exception occurred waiting for alert: Message: no such window: target window already closed
from unknown error: web view not found
(Session info: headless chrome=112.0.5615.165)
Stacktrace:
#0 0x556abadcdfe3 <unknown>
#1 0x556abab0cd36 <unknown>
#2 0x556abaae7b2c <unknown>
#3 0x556abab6f83f <unknown>
#4 0x556abab23ed1 <unknown>
#5 0x556abab6a693 <unknown>
#6 0x556abab3d03a <unknown>
#7 0x556abab3e17e <unknown>
#8 0x556abad8fdbd <unknown>
#9 0x556abad93c6c <unknown>
#10 0x556abad9d4b0 <unknown>
#11 0x556abad94d63 <unknown>
#12 0x556abad67c35 <unknown>
#13 0x556abadb8138 <unknown>
#14 0x556abadb82c7 <unknown>
#15 0x556abadc6093 <unknown>
#16 0x7f82165beb43 <unknown>
Noting a couple of differences. First when it fails there seems to be a 200 response from the alert/text webdriver command. And then when it passes we see that the NoSuchWindow exception is thrown. This may be narrowed down to adding that exception to the handle alert code.
This is placeholder to look at strange results we are seeing with the acceptance tests.
- Vorherrschende Sprache
- Python
- Sterne
- 1.5k
- Forks
- 787
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Entwicklungsumgebung
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus robotframework/SeleniumLibrary
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 67/100
robotframework/SeleniumLibrary#1941 · 3 Kommentare ·
-
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 65/100
robotframework/SeleniumLibrary#1833 ·
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
robotframework/SeleniumLibrary#1436 · 5 Kommentare ·
-
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 58/100
robotframework/SeleniumLibrary#1993 ·
-
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 35/100
robotframework/SeleniumLibrary#1992 · 4 Kommentare ·
Alle Issues in robotframework/SeleniumLibrary
Ähnliche Issues
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
-
bug
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 88/100
qgis/QGIS-Plugins-Website#459 ·
-
bug severity:medium
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
Maintainer antworten meist innerhalb von 2 Tagen
-
bot-found bug priority: P3
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 84/100
madenvel/KalinkaPlayer#179 ·
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
ls1intum/edutelligence#1098 ·
Maintainer antworten meist innerhalb von 1 Tag