2

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`
keepAlive
  • 6,369
  • 5
  • 24
  • 39
  • Update the question with the error stack trace as in `"index=0"` and other relevant details instead of external links. – undetected Selenium May 17 '18 at 08:08
  • it's too long to add as a comment. Can I enter it through the answer button? –  May 17 '18 at 08:36
  • Instead of adding this information as a comment, update the main question with this information for a proper analysis, – undetected Selenium May 17 '18 at 08:43
  • Does frame contains any attribute ? like id or class name or anything ? – cruisepandey May 17 '18 at 09:08
  • Yes. but even when I use them (which was part of the original code) it still doesn't work. I used selenium.click("id=_application_portlet_WAR_morcmsportlet_btnAddHQAddress") –  May 17 '18 at 09:12

1 Answers1

2

This error message...

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'

...implies that the ChromeDriver was unable to find the desired frame and raised SeleniumException: no such frame.

You have exactly three issues here as follows :

You have invoked click() on an element, switched frame and invoked click() within the frame back to back as follows :

selenium.click('id=_application_portlet_WAR_morcmsportlet_btnAddHQAddress')
selenium.selectFrame('index=0')
selenium.click('id=_application_portlet_WAR_morcmsportlet_postalTx')

Ideally once you click() on an element which opens the desired frame to switch to the frame you need to induce WebDriverWait for the frame to be available and then switch to it as follows (Python version) :

#WebDriverWait for frame_to_be_available_and_switch_to_it
WebDriverWait(driver, 10).until(EC.frame_to_be_available_and_switch_to_it(By.ID,"id_of_iframe"))
#or
WebDriverWait(driver, 10).until(EC.frame_to_be_available_and_switch_to_it(By.NAME,"name_of_iframe"))

Here you will find a detailed discussion on How can I select a html element no matter what frame it is in in selenium?

Moving forward, to invoke click() on an element within the frame again you must induce WebDriverwait for the element to be clickable as follows (Python version) :

WebDriverWait(driver, 10).until(EC.element_to_be_clickable((By.ID, "elementID"))).click()

However, your major issue seems to be the version compatibility between the binaries you are using as follows :

  • You are using chromedriver=2.35
  • Release Notes of chromedriver=2.35 clearly mentions the following :

Supports Chrome v62-64

  • You are using chrome=66.0
  • Release Notes of ChromeDriver v2.38 clearly mentions the following :

Supports Chrome v65-67

  • Your Selenium Client version is 3.7.1 of 2017-11-06T21:07:36.161Z which is a bit older.

So there is a clear mismatch between the Selenium Client v3.7.1 , ChromeDriver v2.35 and the Chrome Browser v66.0

Solution

  • Upgrade Selenium to current levels Version 3.12.0.
  • Upgrade ChromeDriver to current ChromeDriver v2.38 level.
  • Keep Chrome version at Chrome v66.x levels. (as per ChromeDriver v2.38 release notes)
  • Clean your Project Workspace through your IDE and Rebuild your project with required dependencies only.
  • Use CCleaner tool to wipe off all the OS chores before and after the execution of your test Suite.
  • If your base Web Client version is too old, then uninstall it through Revo Uninstaller and install a recent GA and released version of Web Client.
  • Take a System Reboot.
  • Execute your @Test.
undetected Selenium
  • 183,867
  • 41
  • 278
  • 352
  • Sorry. I'm still a bit lost. I'm using Katalon Studio. I just updated my chromedriver. So your'e telling me i need to call "WebDriverWait(driver, 10).until(EC.frame_to_be_available_and_switch_to_it(By.ID,'id_of_iframe'))" without adding "selenium." infront? because all the other lines have it. –  May 18 '18 at 06:41
  • when I try changing the id and inserting the line of code you prompted, I still get this error. "groovy.lang.MissingMethodException: No signature of method:" –  May 18 '18 at 06:43
  • That was a python specific illustration of _WebDriverWait_. I am not sure how `Katalon Studio` handles it – undetected Selenium May 18 '18 at 06:45