The following issue I am facing may be due to my lack of knowledge of Selenese. This is the first time I am using Katalon Studio and I am very confused by the issue I am facing, because it seemed to be working on Katalon Recorder, but the exported script doesn't work on Studio. I am pretty sure I need to change my code, but I don't know to what.
The following details about my question are coppied from my earlier post on Katalon Forum that has screenshots to help clarify what my descriptions are. You can find my enquiry at this link: https://forum.katalon.com/discussion/6746/popup-form-not-recognized#latest.
Popup Form Not Recognized
I am automating a sign up form on a company website.
There is a part of that form where a button "Add HQ Address" needs to be clicked
This will open a popup (I think it is called a Modal Window) where more data is to be entered:
The Selenium Studio 5.4.1 that I use is not able to focus on this new window and continues to say the respective ID or index is not found.
For your information, I recorded filling this form using the Katalon Recorder IDE Chrome Extension and then exported the script in selenese for Katalon Studio.
selenium.click('id=_application_portlet_WAR_morcmsportlet_btnAddHQAddress')
selenium.selectFrame('index=0')
selenium.click('id=_application_portlet_WAR_morcmsportlet_postalTx')
The error occurs at the "index=0' line.
This is the console log:
> `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`
This is the error message:
> `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`