Следующая проблема, с которой я сталкиваюсь, может быть связана с моим незнанием Селены Это первый раз, когда я использую Katalon Studio, и меня очень смущает проблема, с которой я сталкиваюсь, потому что она, похоже, работает на Katalon Recorder, но экспортированный скрипт не работает на Studio. Я почти уверен, что мне нужно изменить свой код, но я не знаю на что.
Следующие подробности о моем вопросе взяты из моего предыдущего поста на форуме Katalon, на котором есть скриншоты, чтобы прояснить, каковы мои описания. Вы можете найти мой запрос по этой ссылке: https://forum.katalon.com/discussion/6746/popup-form-not-recognized#latest.
Всплывающая форма не распознана
Я автоматизирую форму регистрации на сайте компании.
В этой форме есть часть, где нужно нажать кнопку «Добавить HQ-адрес»
Откроется всплывающее окно (я думаю, это называется модальным окном), в которое нужно ввести больше данных:
Используемая мной Selenium Studio 5.4.1 не может сосредоточиться на этом новом окне и продолжает говорить, что соответствующий идентификатор или индекс не найден.
Для вашего сведения, я записал заполнение этой формы, используя расширение IDE Chrome Katalon Recorder, а затем экспортировал сценарий на selenese для Katalon Studio.
selenium.click('id=_application_portlet_WAR_morcmsportlet_btnAddHQAddress')
selenium.selectFrame('index=0')
selenium.click('id=_application_portlet_WAR_morcmsportlet_postalTx')
Ошибка возникает в строке "index = 0".
Это журнал консоли:
> `05-17-2018 04:32:39 PM - [START] - Start Test Case : Test Cases/New Test Case 1
05-17-2018 04:32:39 PM - [INFO] - Evaluating variables for test case
05-17-2018 04:32:40 PM - [START] - Start action : openBrowser
05-17-2018 04:32:41 PM - [INFO] - Opening browser
05-17-2018 04:32:41 PM - [INFO] - Starting 'Chrome' driver
05-17-2018 04:32:41 PM - [INFO] - Action delay is set to 0 seconds
Starting ChromeDriver 2.35.528161 (5b82f2d2aae0ca24b877009200ced9065a772e73) on port 3131
Only local connections are allowed.
May 17, 2018 4:32:51 PM org.openqa.selenium.remote.ProtocolHandshake createSession
INFO: Detected dialect: OSS
05-17-2018 04:33:12 PM - [RUN_DATA] - Logging run data 'sessionId' with value '6ea4d9fdedc35b6cbe8830fc3aa58d10'
05-17-2018 04:33:12 PM - [RUN_DATA] - Logging run data 'browser' with value 'Chrome 66.0.3359.139'
05-17-2018 04:33:12 PM - [RUN_DATA] - Logging run data 'platform' with value 'Windows 7'
05-17-2018 04:33:12 PM - [RUN_DATA] - Logging run data 'seleniumVersion' with value '3.7.1'
05-17-2018 04:33:12 PM - [RUN_DATA] - Logging run data 'proxyInformation' with value 'ProxyInformation{proxyOption=USE_SYSTEM, proxyServerType=HTTP, password=, proxyServerAddress=, proxyServerPort=0}'
05-17-2018 04:33:12 PM - [INFO] - Navigating browser to: 'https://mo-uat.nets.com.sg/group/main'
05-17-2018 04:33:16 PM - [PASSED] - Browser is opened with url: 'https://mo-uat.nets.com.sg/group/main'
05-17-2018 04:33:16 PM - [END] - End action : openBrowser
05-17-2018 04:33:16 PM - [START] - Start action : Statement - java.lang.System.setProperty("webdriver.chrome.driver", "C:\Users\vilvamanggkhai\Documents\Stuidio\chromedriver.exe")
05-17-2018 04:33:16 PM - [END] - End action : Statement - java.lang.System.setProperty("webdriver.chrome.driver", "C:\Users\vilvamanggkhai\Documents\Stuidio\chromedriver.exe")
05-17-2018 04:33:16 PM - [START] - Start action : Statement - driver = com.kms.katalon.core.webui.driver.DriverFactory.getWebDriver()
05-17-2018 04:33:16 PM - [END] - End action : Statement - driver = com.kms.katalon.core.webui.driver.DriverFactory.getWebDriver()
05-17-2018 04:33:16 PM - [START] - Start action : Statement - baseUrl = "https://mo-uat.nets.com.sg/group/main"
05-17-2018 04:33:16 PM - [END] - End action : Statement - baseUrl = "https://mo-uat.nets.com.sg/group/main"
05-17-2018 04:33:16 PM - [START] - Start action : Statement - selenium = new com.thoughtworks.selenium.webdriven.WebDriverBackedSelenium(driver, baseUrl)
05-17-2018 04:33:16 PM - [END] - End action : Statement - selenium = new com.thoughtworks.selenium.webdriven.WebDriverBackedSelenium(driver, baseUrl)
05-17-2018 04:33:16 PM - [START] - Start action : Statement - selenium.click("id=_58_login")
05-17-2018 04:33:16 PM - [END] - End action : Statement - selenium.click("id=_58_login")
05-17-2018 04:33:16 PM - [START] - Start action : Statement - selenium.type("id=_58_login", "css.verifier1")
05-17-2018 04:33:16 PM - [END] - End action : Statement - selenium.type("id=_58_login", "css.verifier1")
05-17-2018 04:33:16 PM - [START] - Start action : Statement - selenium.click("id=_58_password")
05-17-2018 04:33:16 PM - [END] - End action : Statement - selenium.click("id=_58_password")
05-17-2018 04:33:16 PM - [START] - Start action : Statement - selenium.type("id=_58_password", "P@ssw0rd")
05-17-2018 04:33:16 PM - [END] - End action : Statement - selenium.type("id=_58_password", "P@ssw0rd")
05-17-2018 04:33:16 PM - [START] - Start action : Statement - selenium.click("//button[@type='submit']")
05-17-2018 04:33:23 PM - [END] - End action : Statement - selenium.click("//button[@type='submit']")
05-17-2018 04:33:23 PM - [START] - Start action : Statement - selenium.open("https://mo-uat.nets.com.sg/group/main/create-application")
05-17-2018 04:33:25 PM - [END] - End action : Statement - selenium.open("https://mo-uat.nets.com.sg/group/main/create-application")
05-17-2018 04:33:25 PM - [START] - Start action : Statement - selenium.open("https://mo-uat.nets.com.sg/group/main/create-application?p_p_id=application_portlet_WAR_morcmsportlet&p_p_lifecycle=0&p_p_state=normal&p_p_mode=view&p_p_col_id=column-1&p_p_col_count=1&_application_portlet_WAR_morcmsportlet_showTab=Application&_application_portlet_WAR_morcmsportlet_render=createAppLoadCustomer")
05-17-2018 04:33:26 PM - [END] - End action : Statement - selenium.open("https://mo-uat.nets.com.sg/group/main/create-application?p_p_id=application_portlet_WAR_morcmsportlet&p_p_lifecycle=0&p_p_state=normal&p_p_mode=view&p_p_col_id=column-1&p_p_col_count=1&_application_portlet_WAR_morcmsportlet_showTab=Application&_application_portlet_WAR_morcmsportlet_render=createAppLoadCustomer")
05-17-2018 04:33:26 PM - [START] - Start action : Statement - selenium.type("id=_application_portlet_WAR_morcmsportlet_custIdNo", "oijl78g84")
05-17-2018 04:33:26 PM - [END] - End action : Statement - selenium.type("id=_application_portlet_WAR_morcmsportlet_custIdNo", "oijl78g84")
05-17-2018 04:33:26 PM - [START] - Start action : Statement - selenium.click("id=_application_portlet_WAR_morcmsportlet_custIdType")
05-17-2018 04:33:26 PM - [END] - End action : Statement - selenium.click("id=_application_portlet_WAR_morcmsportlet_custIdType")
05-17-2018 04:33:26 PM - [START] - Start action : Statement - selenium.select("id=_application_portlet_WAR_morcmsportlet_custIdType", "label=ACRA")
05-17-2018 04:33:27 PM - [END] - End action : Statement - selenium.select("id=_application_portlet_WAR_morcmsportlet_custIdType", "label=ACRA")
05-17-2018 04:33:27 PM - [START] - Start action : Statement - selenium.click("id=_application_portlet_WAR_morcmsportlet_custIdType")
05-17-2018 04:33:27 PM - [END] - End action : Statement - selenium.click("id=_application_portlet_WAR_morcmsportlet_custIdType")
05-17-2018 04:33:27 PM - [START] - Start action : Statement - selenium.click("id=_application_portlet_WAR_morcmsportlet_btnProceed")
05-17-2018 04:33:30 PM - [END] - End action : Statement - selenium.click("id=_application_portlet_WAR_morcmsportlet_btnProceed")
05-17-2018 04:33:30 PM - [START] - Start action : Statement - selenium.click("id=_application_portlet_WAR_morcmsportlet_salesConsultantCd")
05-17-2018 04:33:30 PM - [END] - End action : Statement - selenium.click("id=_application_portlet_WAR_morcmsportlet_salesConsultantCd")
05-17-2018 04:33:30 PM - [START] - Start action : Statement - selenium.select("id=_application_portlet_WAR_morcmsportlet_salesConsultantCd", "label=VALERIE CHEE HSIN YEE")
05-17-2018 04:33:31 PM - [END] - End action : Statement - selenium.select("id=_application_portlet_WAR_morcmsportlet_salesConsultantCd", "label=VALERIE CHEE HSIN YEE")
05-17-2018 04:33:31 PM - [START] - Start action : Statement - selenium.click("id=_application_portlet_WAR_morcmsportlet_salesConsultantCd")
05-17-2018 04:33:31 PM - [END] - End action : Statement - selenium.click("id=_application_portlet_WAR_morcmsportlet_salesConsultantCd")
05-17-2018 04:33:31 PM - [START] - Start action : Statement - selenium.click("Xpath=//*[contains(text(),' Profile ')]")
05-17-2018 04:33:31 PM - [END] - End action : Statement - selenium.click("Xpath=//*[contains(text(),' Profile ')]")
05-17-2018 04:33:31 PM - [START] - Start action : Statement - selenium.click("id=_application_portlet_WAR_morcmsportlet_custNameTx")
05-17-2018 04:33:31 PM - [END] - End action : Statement - selenium.click("id=_application_portlet_WAR_morcmsportlet_custNameTx")
05-17-2018 04:33:31 PM - [START] - Start action : Statement - selenium.type("id=_application_portlet_WAR_morcmsportlet_custNameTx", "company name")
05-17-2018 04:33:31 PM - [END] - End action : Statement - selenium.type("id=_application_portlet_WAR_morcmsportlet_custNameTx", "company name")
05-17-2018 04:33:31 PM - [START] - Start action : Statement - selenium.click("id=_application_portlet_WAR_morcmsportlet_businessTypeCd")
05-17-2018 04:33:32 PM - [END] - End action : Statement - selenium.click("id=_application_portlet_WAR_morcmsportlet_businessTypeCd")
05-17-2018 04:33:32 PM - [START] - Start action : Statement - selenium.select("id=_application_portlet_WAR_morcmsportlet_businessTypeCd", "label=PTE LTD")
05-17-2018 04:33:32 PM - [END] - End action : Statement - selenium.select("id=_application_portlet_WAR_morcmsportlet_businessTypeCd", "label=PTE LTD")
05-17-2018 04:33:32 PM - [START] - Start action : Statement - selenium.click("id=_application_portlet_WAR_morcmsportlet_businessTypeCd")
05-17-2018 04:33:32 PM - [END] - End action : Statement - selenium.click("id=_application_portlet_WAR_morcmsportlet_businessTypeCd")
05-17-2018 04:33:32 PM - [START] - Start action : Statement - selenium.click("id=_application_portlet_WAR_morcmsportlet_custDt_corp")
05-17-2018 04:33:33 PM - [END] - End action : Statement - selenium.click("id=_application_portlet_WAR_morcmsportlet_custDt_corp")
05-17-2018 04:33:33 PM - [START] - Start action : Statement - selenium.type("id=_application_portlet_WAR_morcmsportlet_custDt_corp", "07/05/2018")
05-17-2018 04:33:33 PM - [END] - End action : Statement - selenium.type("id=_application_portlet_WAR_morcmsportlet_custDt_corp", "07/05/2018")
05-17-2018 04:33:33 PM - [START] - Start action : Statement - selenium.click("id=_application_portlet_WAR_morcmsportlet_btnAddHQAddress")
05-17-2018 04:33:33 PM - [END] - End action : Statement - selenium.click("id=_application_portlet_WAR_morcmsportlet_btnAddHQAddress")
05-17-2018 04:33:33 PM - [START] - Start action : Statement - selenium.selectFrame("index=0")
05-17-2018 04:33:33 PM - [END] - End action : Statement - selenium.selectFrame("index=0")
05-17-2018 04:33:33 PM - [ERROR] - Test Cases/New Test Case 1 FAILED because (of) com.thoughtworks.selenium.SeleniumException: no such frame
(Session info: chrome=66.0.3359.139)
(Driver info: chromedriver=2.35.528161 (5b82f2d2aae0ca24b877009200ced9065a772e73),platform=Windows NT 6.1.7601 SP1 x86) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 0 milliseconds
Build info: version: '3.7.1', revision: '8a0099a', time: '2017-11-06T21:07:36.161Z'
System info: host: 'NB7INTERN18M', ip: '176.175.12.39', os.name: 'Windows 7', os.arch: 'x86', os.version: '6.1', java.version: '1.8.0_102'
Driver info: com.kms.katalon.selenium.driver.CChromeDriver
Capabilities {acceptInsecureCerts: false, acceptSslCerts: false, applicationCacheEnabled: false, browserConnectionEnabled: false, browserName: chrome, chrome: {chromedriverVersion: 2.35.528161 (5b82f2d2aae0ca..., userDataDir: C:\Users\vilvamanggkhai\App...}, cssSelectorsEnabled: true, databaseEnabled: false, handlesAlerts: true, hasTouchScreen: false, javascriptEnabled: true, locationContextEnabled: true, mobileEmulationEnabled: false, nativeEvents: true, networkConnectionEnabled: false, pageLoadStrategy: normal, platform: XP, platformName: XP, rotatable: false, setWindowRect: true, takesHeapSnapshot: true, takesScreenshot: true, unexpectedAlertBehaviour: , unhandledPromptBehavior: , version: 66.0.3359.139, webStorageEnabled: true}
Session ID: 6ea4d9fdedc35b6cbe8830fc3aa58d10
05-17-2018 04:33:33 PM - [END] - End Test Case : Test Cases/New Test Case 1`
Это сообщение об ошибке:
> `Test Cases/New Test Case 1 FAILED because (of) com.thoughtworks.selenium.SeleniumException: no such frame
(Session info: chrome=66.0.3359.139)
(Driver info: chromedriver=2.35.528161 (5b82f2d2aae0ca24b877009200ced9065a772e73),platform=Windows NT 6.1.7601 SP1 x86) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 0 milliseconds
Build info: version: '3.7.1', revision: '8a0099a', time: '2017-11-06T21:07:36.161Z'
System info: host: 'NB7INTERN18M', ip: '176.175.12.39', os.name: 'Windows 7', os.arch: 'x86', os.version: '6.1', java.version: '1.8.0_102'
Driver info: com.kms.katalon.selenium.driver.CChromeDriver
Capabilities {acceptInsecureCerts: false, acceptSslCerts: false, applicationCacheEnabled: false, browserConnectionEnabled: false, browserName: chrome, chrome: {chromedriverVersion: 2.35.528161 (5b82f2d2aae0ca..., userDataDir: C:\Users\vilvamanggkhai\App...}, cssSelectorsEnabled: true, databaseEnabled: false, handlesAlerts: true, hasTouchScreen: false, javascriptEnabled: true, locationContextEnabled: true, mobileEmulationEnabled: false, nativeEvents: true, networkConnectionEnabled: false, pageLoadStrategy: normal, platform: XP, platformName: XP, rotatable: false, setWindowRect: true, takesHeapSnapshot: true, takesScreenshot: true, unexpectedAlertBehaviour: , unhandledPromptBehavior: , version: 66.0.3359.139, webStorageEnabled: true}
Session ID: 6ea4d9fdedc35b6cbe8830fc3aa58d10
Test Cases/New Test Case 1.run:87`