Help With Katalon And Python export


#1

Hi.

I’m a new to the sport of Katalon and also Pyhton.

I’m trying to make a python script to press a button on my backend of opencart to generate a sitemap and i’m stuck at # ERROR: Caught exception [ERROR: Unsupported command [selectFrame | index=1 | ]].

When i run play it from Katalon Recorder all work perfect, but when i export it and run it on python is not run because it cant find the next step…

This is the full Code that Katalon Export.

-- coding: utf-8 --

from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.support.ui import Select
from selenium.common.exceptions import NoSuchElementException
from selenium.common.exceptions import NoAlertPresentException
import unittest, time, re

class IntelcomSitemapGen1(unittest.TestCase):
def setUp(self):
self.driver = webdriver.Firefox()
self.driver.implicitly_wait(30)
self.base_url = “https://www.xxxxxxxxxxxxxx.gr/admin/
self.verificationErrors = []
self.accept_next_alert = True

def test_intelcom_sitemap_gen1(self):
    driver = self.driver
    driver.get("https://www.xxxxxxxxxxxxxx.gr/admin/")
    driver.find_element_by_name("username").clear()
    driver.find_element_by_name("username").send_keys("xxxxxxxxx")
    driver.find_element_by_name("password").clear()
    driver.find_element_by_name("password").send_keys("xxxxxxxxxx")
    driver.find_element_by_link_text(u"text1").click()
    driver.find_element_by_link_text(u"text2").click()
    driver.find_element_by_link_text("text3").click()
    driver.find_element_by_link_text("text4").click()
    driver.find_element_by_id("conector").click()
    # ERROR: Caught exception [ERROR: Unsupported command [selectFrame | index=0 | ]]
    # ERROR: Caught exception [ERROR: Unsupported command [selectFrame | relative=parent | ]]
    # ERROR: Caught exception [ERROR: Unsupported command [selectFrame | index=1 | ]]
    driver.find_element_by_xpath("(.//*[normalize-space(text()) and normalize-space(.)='SITEMAP GENERATOR'])[1]/following::ul[1]").click()
    driver.find_element_by_xpath("(.//*[normalize-space(text()) and normalize-space(.)='SITEMAP GENERATOR'])[1]/following::div[1]").click()
    driver.find_element_by_link_text(u"Generate all Sitemaps for xxxxxxxxxxxxxx").click()
    driver.find_element_by_xpath("(.//*[normalize-space(text()) and normalize-space(.)='Exit'])[1]/following::td[1]").click()
    driver.find_element_by_link_text("Exit").click()
    driver.close()

def is_element_present(self, how, what):
    try: self.driver.find_element(by=how, value=what)
    except NoSuchElementException as e: return False
    return True

def is_alert_present(self):
    try: self.driver.switch_to_alert()
    except NoAlertPresentException as e: return False
    return True

def close_alert_and_get_its_text(self):
    try:
        alert = self.driver.switch_to_alert()
        alert_text = alert.text
        if self.accept_next_alert:
            alert.accept()
        else:
            alert.dismiss()
        return alert_text
    finally: self.accept_next_alert = True

def tearDown(self):
    self.driver.quit()
    self.assertEqual([], self.verificationErrors)

if name == “main”:
unittest.main()

Can you give a hand…

Thanks.