xiaobei_selenium_automation/reports/9aadc58b-21c1-4bfa-b912-874...

1 line
12 KiB
JSON

{"name": "test_001[user2-pass2]", "status": "broken", "statusDetails": {"message": "selenium.common.exceptions.NoSuchWindowException: Message: no such window: target window already closed\nfrom unknown error: web view not found\n (Session info: chrome=114.0.5735.199)\nStacktrace:\nBacktrace:\n\tGetHandleVerifier [0x0038A813+48355]\n\t(No symbol) [0x0031C4B1]\n\t(No symbol) [0x00225358]\n\t(No symbol) [0x0020D293]\n\t(No symbol) [0x0026E37B]\n\t(No symbol) [0x0027C473]\n\t(No symbol) [0x0026A536]\n\t(No symbol) [0x002482DC]\n\t(No symbol) [0x002493DD]\n\tGetHandleVerifier [0x005EAABD+2539405]\n\tGetHandleVerifier [0x0062A78F+2800735]\n\tGetHandleVerifier [0x0062456C+2775612]\n\tGetHandleVerifier [0x004151E0+616112]\n\t(No symbol) [0x00325F8C]\n\t(No symbol) [0x00322328]\n\t(No symbol) [0x0032240B]\n\t(No symbol) [0x00314FF7]\n\tBaseThreadInitThunk [0x764B00C9+25]\n\tRtlGetAppContainerNamedObjectPath [0x77507B1E+286]\n\tRtlGetAppContainerNamedObjectPath [0x77507AEE+238]", "trace": "self = <testcases.zhuifeng_tc.test_ddt_zhuifeng.TestSearch2 object at 0x0000023781F67890>\ndrivers = <selenium.webdriver.chrome.webdriver.WebDriver (session=\"d6a009519ce6c9005feaa55b6931f2b6\")>\nusername = 'user2', password = 'pass2'\n\n @pytest.mark.smoke\n @pytest.mark.parametrize('username, password', [\n ('user1', 'pass1'),\n ('user2', 'pass2'),\n ('wzz', '12345')\n ])\n def test_001(self, drivers, username, password):\n zhufeng = zhuifeng_index_page(drivers)\n> zhufeng.input_account = username\n\ntestcases\\zhuifeng_tc\\test_ddt_zhuifeng.py:45: \n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _\npage\\basePage.py:80: in __set__\n elem = self.__get__(instance, instance.__class__)\npage\\basePage.py:74: in __get__\n return WebDriverWait(context, 5, 1).until(lambda x: x.find_element(*self.locator))\n..\\..\\env_dependence\\Python\\Lib\\site-packages\\selenium\\webdriver\\support\\wait.py:86: in until\n value = method(self._driver)\npage\\basePage.py:74: in <lambda>\n return WebDriverWait(context, 5, 1).until(lambda x: x.find_element(*self.locator))\n..\\..\\env_dependence\\Python\\Lib\\site-packages\\selenium\\webdriver\\remote\\webdriver.py:831: in find_element\n return self.execute(Command.FIND_ELEMENT, {\"using\": by, \"value\": value})[\"value\"]\n..\\..\\env_dependence\\Python\\Lib\\site-packages\\selenium\\webdriver\\remote\\webdriver.py:440: in execute\n self.error_handler.check_response(response)\n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _\n\nself = <selenium.webdriver.remote.errorhandler.ErrorHandler object at 0x00000237FFDA3BD0>\nresponse = {'status': 404, 'value': '{\"value\":{\"error\":\"no such window\",\"message\":\"no such window: target window already closed\\\\...\\n\\\\tRtlGetAppContainerNamedObjectPath [0x77507B1E+286]\\\\n\\\\tRtlGetAppContainerNamedObjectPath [0x77507AEE+238]\\\\n\"}}'}\n\n def check_response(self, response: Dict[str, Any]) -> None:\n \"\"\"Checks that a JSON response from the WebDriver does not have an\n error.\n \n :Args:\n - response - The JSON response from the WebDriver server as a dictionary\n object.\n \n :Raises: If the response contains an error message.\n \"\"\"\n status = response.get(\"status\", None)\n if not status or status == ErrorCode.SUCCESS:\n return\n value = None\n message = response.get(\"message\", \"\")\n screen: str = response.get(\"screen\", \"\")\n stacktrace = None\n if isinstance(status, int):\n value_json = response.get(\"value\", None)\n if value_json and isinstance(value_json, str):\n import json\n \n try:\n value = json.loads(value_json)\n if len(value) == 1:\n value = value[\"value\"]\n status = value.get(\"error\", None)\n if not status:\n status = value.get(\"status\", ErrorCode.UNKNOWN_ERROR)\n message = value.get(\"value\") or value.get(\"message\")\n if not isinstance(message, str):\n value = message\n message = message.get(\"message\")\n else:\n message = value.get(\"message\", None)\n except ValueError:\n pass\n \n exception_class: Type[WebDriverException]\n if status in ErrorCode.NO_SUCH_ELEMENT:\n exception_class = NoSuchElementException\n elif status in ErrorCode.NO_SUCH_FRAME:\n exception_class = NoSuchFrameException\n elif status in ErrorCode.NO_SUCH_SHADOW_ROOT:\n exception_class = NoSuchShadowRootException\n elif status in ErrorCode.NO_SUCH_WINDOW:\n exception_class = NoSuchWindowException\n elif status in ErrorCode.STALE_ELEMENT_REFERENCE:\n exception_class = StaleElementReferenceException\n elif status in ErrorCode.ELEMENT_NOT_VISIBLE:\n exception_class = ElementNotVisibleException\n elif status in ErrorCode.INVALID_ELEMENT_STATE:\n exception_class = InvalidElementStateException\n elif (\n status in ErrorCode.INVALID_SELECTOR\n or status in ErrorCode.INVALID_XPATH_SELECTOR\n or status in ErrorCode.INVALID_XPATH_SELECTOR_RETURN_TYPER\n ):\n exception_class = InvalidSelectorException\n elif status in ErrorCode.ELEMENT_IS_NOT_SELECTABLE:\n exception_class = ElementNotSelectableException\n elif status in ErrorCode.ELEMENT_NOT_INTERACTABLE:\n exception_class = ElementNotInteractableException\n elif status in ErrorCode.INVALID_COOKIE_DOMAIN:\n exception_class = InvalidCookieDomainException\n elif status in ErrorCode.UNABLE_TO_SET_COOKIE:\n exception_class = UnableToSetCookieException\n elif status in ErrorCode.TIMEOUT:\n exception_class = TimeoutException\n elif status in ErrorCode.SCRIPT_TIMEOUT:\n exception_class = TimeoutException\n elif status in ErrorCode.UNKNOWN_ERROR:\n exception_class = WebDriverException\n elif status in ErrorCode.UNEXPECTED_ALERT_OPEN:\n exception_class = UnexpectedAlertPresentException\n elif status in ErrorCode.NO_ALERT_OPEN:\n exception_class = NoAlertPresentException\n elif status in ErrorCode.IME_NOT_AVAILABLE:\n exception_class = ImeNotAvailableException\n elif status in ErrorCode.IME_ENGINE_ACTIVATION_FAILED:\n exception_class = ImeActivationFailedException\n elif status in ErrorCode.MOVE_TARGET_OUT_OF_BOUNDS:\n exception_class = MoveTargetOutOfBoundsException\n elif status in ErrorCode.JAVASCRIPT_ERROR:\n exception_class = JavascriptException\n elif status in ErrorCode.SESSION_NOT_CREATED:\n exception_class = SessionNotCreatedException\n elif status in ErrorCode.INVALID_ARGUMENT:\n exception_class = InvalidArgumentException\n elif status in ErrorCode.NO_SUCH_COOKIE:\n exception_class = NoSuchCookieException\n elif status in ErrorCode.UNABLE_TO_CAPTURE_SCREEN:\n exception_class = ScreenshotException\n elif status in ErrorCode.ELEMENT_CLICK_INTERCEPTED:\n exception_class = ElementClickInterceptedException\n elif status in ErrorCode.INSECURE_CERTIFICATE:\n exception_class = InsecureCertificateException\n elif status in ErrorCode.INVALID_COORDINATES:\n exception_class = InvalidCoordinatesException\n elif status in ErrorCode.INVALID_SESSION_ID:\n exception_class = InvalidSessionIdException\n elif status in ErrorCode.UNKNOWN_METHOD:\n exception_class = UnknownMethodException\n else:\n exception_class = WebDriverException\n if not value:\n value = response[\"value\"]\n if isinstance(value, str):\n raise exception_class(value)\n if message == \"\" and \"message\" in value:\n message = value[\"message\"]\n \n screen = None # type: ignore[assignment]\n if \"screen\" in value:\n screen = value[\"screen\"]\n \n stacktrace = None\n st_value = value.get(\"stackTrace\") or value.get(\"stacktrace\")\n if st_value:\n if isinstance(st_value, str):\n stacktrace = st_value.split(\"\\n\")\n else:\n stacktrace = []\n try:\n for frame in st_value:\n line = frame.get(\"lineNumber\", \"\")\n file = frame.get(\"fileName\", \"<anonymous>\")\n if line:\n file = f\"{file}:{line}\"\n meth = frame.get(\"methodName\", \"<anonymous>\")\n if \"className\" in frame:\n meth = f\"{frame['className']}.{meth}\"\n msg = \" at %s (%s)\"\n msg = msg % (meth, file)\n stacktrace.append(msg)\n except TypeError:\n pass\n if exception_class == UnexpectedAlertPresentException:\n alert_text = None\n if \"data\" in value:\n alert_text = value[\"data\"].get(\"text\")\n elif \"alert\" in value:\n alert_text = value[\"alert\"].get(\"text\")\n raise exception_class(message, screen, stacktrace, alert_text) # type: ignore[call-arg] # mypy is not smart enough here\n> raise exception_class(message, screen, stacktrace)\nE selenium.common.exceptions.NoSuchWindowException: Message: no such window: target window already closed\nE from unknown error: web view not found\nE (Session info: chrome=114.0.5735.199)\nE Stacktrace:\nE Backtrace:\nE \tGetHandleVerifier [0x0038A813+48355]\nE \t(No symbol) [0x0031C4B1]\nE \t(No symbol) [0x00225358]\nE \t(No symbol) [0x0020D293]\nE \t(No symbol) [0x0026E37B]\nE \t(No symbol) [0x0027C473]\nE \t(No symbol) [0x0026A536]\nE \t(No symbol) [0x002482DC]\nE \t(No symbol) [0x002493DD]\nE \tGetHandleVerifier [0x005EAABD+2539405]\nE \tGetHandleVerifier [0x0062A78F+2800735]\nE \tGetHandleVerifier [0x0062456C+2775612]\nE \tGetHandleVerifier [0x004151E0+616112]\nE \t(No symbol) [0x00325F8C]\nE \t(No symbol) [0x00322328]\nE \t(No symbol) [0x0032240B]\nE \t(No symbol) [0x00314FF7]\nE \tBaseThreadInitThunk [0x764B00C9+25]\nE \tRtlGetAppContainerNamedObjectPath [0x77507B1E+286]\nE \tRtlGetAppContainerNamedObjectPath [0x77507AEE+238]\n\n..\\..\\env_dependence\\Python\\Lib\\site-packages\\selenium\\webdriver\\remote\\errorhandler.py:245: NoSuchWindowException"}, "parameters": [{"name": "username", "value": "'user2'"}, {"name": "password", "value": "'pass2'"}], "start": 1691998115755, "stop": 1691998115758, "uuid": "ee15855b-c6d9-4be8-b5ff-f67ef1bdad75", "historyId": "8f129242676ad0294cab486a80336983", "testCaseId": "f4ef65b043d05db61048415b9c5a1413", "fullName": "testcases.zhuifeng_tc.test_ddt_zhuifeng.TestSearch2#test_001", "labels": [{"name": "tag", "value": "smoke"}, {"name": "parentSuite", "value": "testcases.zhuifeng_tc"}, {"name": "suite", "value": "test_ddt_zhuifeng"}, {"name": "subSuite", "value": "TestSearch2"}, {"name": "host", "value": "LAPTOP-2RGLO47J"}, {"name": "thread", "value": "68708-MainThread"}, {"name": "framework", "value": "pytest"}, {"name": "language", "value": "cpython3"}, {"name": "package", "value": "testcases.zhuifeng_tc.test_ddt_zhuifeng"}]}