Невозможно выполнить клик на Katalon Studio - PullRequest
0 голосов
/ 19 сентября 2018

Проблема Я новичок в тестировании Katalon и Automation, я перепробовал все, но не смог выполнить функцию щелчка для простой кнопки

Мой код тоже не ошибается, но функция щелчкане выполняется на странице

Веб-страница https://www.ratesupermarket.ca/term_life_insurance

HTML
Получить цитаты 

xpath // button [@ id = 'submit']

Код сценария WebUI.openBrowser ('') 'перейти к URL-адресу' WebUI.navigateToUrl ('https://www.ratesupermarket.ca/term_life_insurance') «Ввести почтовый индекс - перейти на следующую страницу» WebUI.setText (findTestObject («Хранилище объектов / Страница тарифов 1 / Page_Life» / input_postal_code »),« M12W22 ») WebUI.click (findTestObject (« Хранилище объектов / Страница тарифов »)1 / Page_Life Страховое сравнение / button_Get Quotes '))

Console Log

09-19-2018 12:58:17 PM - [START]  - Start Test Case : Test Cases/Perform click and Get Quote
09-19-2018 12:58:17 PM - [INFO]   - Evaluating variables for test case
09-19-2018 12:58:18 PM - [START]  - Start action : openBrowser
09-19-2018 12:58:18 PM - [INFO]   - Opening browser
09-19-2018 12:58:18 PM - [INFO]   - Starting 'IE' driver
09-19-2018 12:58:18 PM - [INFO]   - Action delay is set to 0 seconds
Started InternetExplorerDriver server (32-bit)
3.6.0.0
Listening on port 2893
Log level is set to TRACE
Log file is set to C:\Users\cnawork\AppData\Local\Temp\Katalon\Test Cases\Perform click and Get Quote\20180919_125813\IEDriverServer.log
Only local connections are allowed
Sep 19, 2018 12:58:21 PM org.openqa.selenium.remote.ProtocolHandshake createSession
INFO: Detected dialect: W3C
09-19-2018 12:58:21 PM - [RUN_DATA] - Logging run data 'sessionId' with value '50bd252d-7549-4b1a-9a8c-d9fa80318749'
09-19-2018 12:58:21 PM - [RUN_DATA] - Logging run data 'browser' with value 'IE 11'
09-19-2018 12:58:21 PM - [RUN_DATA] - Logging run data 'platform' with value 'Windows 8.1'
09-19-2018 12:58:21 PM - [RUN_DATA] - Logging run data 'seleniumVersion' with value '3.7.1'
09-19-2018 12:58:21 PM - [RUN_DATA] - Logging run data 'proxyInformation' with value 'ProxyInformation{proxyOption=NO_PROXY, proxyServerType=HTTP, password=, proxyServerAddress=, proxyServerPort=0}'
09-19-2018 12:58:21 PM - [PASSED] - Browser is opened with url: ''
09-19-2018 12:58:21 PM - [END]    - End action : openBrowser
09-19-2018 12:58:21 PM - [START]  - Start action : navigateToUrl
09-19-2018 12:58:21 PM - [INFO]   - Checking url
09-19-2018 12:58:21 PM - [INFO]   - Navigating to 'https://www.ratesupermarket.ca/term_life_insurance'
09-19-2018 12:58:27 PM - [PASSED] - Navigate to 'https://www.ratesupermarket.ca/term_life_insurance' successfully
09-19-2018 12:58:27 PM - [END]    - End action : navigateToUrl
09-19-2018 12:58:27 PM - [START]  - Start action : setText
09-19-2018 12:58:27 PM - [INFO]   - Finding Test Object with id 'Object Repository/Rates Page 1/Page_Life Insurance Comparison/input_postal_code'
09-19-2018 12:58:27 PM - [INFO]   - Checking object
09-19-2018 12:58:27 PM - [INFO]   - Checking text
09-19-2018 12:58:27 PM - [INFO]   - Checking timeout
09-19-2018 12:58:27 PM - [INFO]   - Finding web element with id: 'Object Repository/Rates Page 1/Page_Life Insurance Comparison/input_postal_code' located by 'By.xpath: //input[@id='postal_code']' in '30' second(s)
09-19-2018 12:58:27 PM - [INFO]   - Found 1 web elements with id: 'Object Repository/Rates Page 1/Page_Life Insurance Comparison/input_postal_code' located by 'By.xpath: //input[@id='postal_code']' in '30' second(s)
09-19-2018 12:58:27 PM - [INFO]   - Clearing text of object 'Object Repository/Rates Page 1/Page_Life Insurance Comparison/input_postal_code'
09-19-2018 12:58:27 PM - [INFO]   - Checking timeout
09-19-2018 12:58:27 PM - [INFO]   - Finding web element with id: 'Object Repository/Rates Page 1/Page_Life Insurance Comparison/input_postal_code' located by 'By.xpath: //input[@id='postal_code']' in '30' second(s)
09-19-2018 12:58:27 PM - [INFO]   - Found 1 web elements with id: 'Object Repository/Rates Page 1/Page_Life Insurance Comparison/input_postal_code' located by 'By.xpath: //input[@id='postal_code']' in '30' second(s)
09-19-2018 12:58:27 PM - [INFO]   - Setting text of object 'Object Repository/Rates Page 1/Page_Life Insurance Comparison/input_postal_code' to value 'M12W22'
09-19-2018 12:58:27 PM - [PASSED] - Text 'M12W22' is set on object 'Object Repository/Rates Page 1/Page_Life Insurance Comparison/input_postal_code'
09-19-2018 12:58:27 PM - [END]    - End action : setText
09-19-2018 12:58:27 PM - [START]  - Start action : click
09-19-2018 12:58:27 PM - [INFO]   - Finding Test Object with id 'Object Repository/Rates Page 1/Page_Life Insurance Comparison/button_Get Quotes'
09-19-2018 12:58:27 PM - [INFO]   - Checking object
09-19-2018 12:58:27 PM - [INFO]   - Checking timeout
09-19-2018 12:58:27 PM - [INFO]   - Finding web element with id: 'Object Repository/Rates Page 1/Page_Life Insurance Comparison/button_Get Quotes' located by 'By.xpath: //button[@id='submit']' in '30' second(s)
09-19-2018 12:58:28 PM - [INFO]   - Found 1 web elements with id: 'Object Repository/Rates Page 1/Page_Life Insurance Comparison/button_Get Quotes' located by 'By.xpath: //button[@id='submit']' in '30' second(s)
09-19-2018 12:58:28 PM - [INFO]   - Clicking on object: 'Object Repository/Rates Page 1/Page_Life Insurance Comparison/button_Get Quotes'
09-19-2018 12:58:29 PM - [PASSED] - Object: 'Object Repository/Rates Page 1/Page_Life Insurance Comparison/button_Get Quotes' is clicked on
09-19-2018 12:58:29 PM - [END]    - End action : click
09-19-2018 12:58:29 PM - [PASSED] - Test Cases/Perform click and Get Quote
09-19-2018 12:58:29 PM - [END]    - End Test Case : Test Cases/Perform click and Get Quote

1 Ответ

0 голосов
/ 20 сентября 2018

Попробуйте использовать это ключевое слово:

@Keyword
def clickUsingJS(TestObject to, int timeout)
{ 
    WebDriver driver = DriverFactory.getWebDriver()
    WebElement element = WebUICommonHelper.findWebElement(to, timeout)
    JavaScriptExecutor executor = ((driver)as  JavaScriptExecutor)
    executor.executeScript('arguments[0].click()',element)
}
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...