Review `Handle Alert when popup window closes` test
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 28/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Cần làm rõ
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- python
- Lĩnh vực
- testing-qa
Hướng nghiên cứu
Bắt đầu với kiểm thử chấp nhận “Handle Alert when popup window closes” và so sánh các log thành công và thất bại của lần chạy GitHub Actions được liên kết. Sau đó kiểm tra các đường xử lý alert trong src/SeleniumLibrary/keywords/alert.py, đặc biệt là _handle_alert và _wait_alert; hoàn thành có nghĩa là kiểm thử cho kết quả nhất quán, có thể hiểu được và không còn lỗi cửa sổ hoặc alert đã được báo cáo.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- Python
- Star
- 1.5k
- Fork
- 787
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của robotframework/SeleniumLibrary
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 67/100
robotframework/SeleniumLibrary#1941 · 3 bình luận ·
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 65/100
robotframework/SeleniumLibrary#1833 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
robotframework/SeleniumLibrary#1436 · 5 bình luận ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 58/100
robotframework/SeleniumLibrary#1993 ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
robotframework/SeleniumLibrary#1992 · 4 bình luận ·
Tất cả issue của robotframework/SeleniumLibrary
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
gradio-app/gradio#13895 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
build-error
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
spack/spack-packages#6713 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Use issue templatesĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
ActivityWatch/activitywatch#1464 · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[Bug]: The ckg tool drops the return type of every decorated Python method in class search resultsĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
bytedance/trae-agent#483 ·
Maintainer thường phản hồi trong vòng 1 ngày