Unable to Click on Button

Unable to Click on Button

============================

I am a beginner in Automation Testing and unable to find solution for how to click on Buttons
Even though this button is not clicked, My test case did not fail and that is kinda strange behaviour

Below is My Code -

WebUI.openBrowser(‘’)

‘go to URL’

WebUI.navigateToUrl('https://www.ratesupermarket.ca/term_life_insurance’)

‘Enter Post code - Go to next Page’

WebUI.setText(findTestObject(‘Rates Page 1/Page_Life Insurance Comparison/input_postal_code’), ‘M4P1R3’)

WebUI.verifyTextPresent(‘Get Quotes’, false)

WebUI.click(findTestObject(‘Rates Page 1/Page_Life Insurance Comparison/button_Get Quotes’))

**HTML Tags - **

Get Quotes

Xpath used in Object repository - //button[@id=‘submit’] ;

I have tried some other variations but in all cases button is not clicked
Submit instead of Click
Use other attributed like class, Id etc
Not able to click buttons on any test case

please add console log so we can see messages (and errors)

Andrej Podhajský said:

please add console log so we can see messages (and errors)

There are no Errors related to click - Below is Console Log

09-19-2018 04:33:48 PM - [START] - Start Test Case : Test Cases/Change of X path Tests

09-19-2018 04:33:48 PM - [INFO] - Evaluating variables for test case

09-19-2018 04:33:49 PM - [START] - Start action : openBrowser

09-19-2018 04:33:50 PM - [INFO] - Opening browser

09-19-2018 04:33:50 PM - [INFO] - Starting ‘IE’ driver

09-19-2018 04:33:50 PM - [INFO] - Action delay is set to 0 seconds

Started InternetExplorerDriver server (32-bit)

3.6.0.0

Listening on port 33626

Log level is set to TRACE

Log file is set to C:\Users\cnawork\AppData\Local\Temp\Katalon\Test Cases\Change of X path Tests\20180919_163343\IEDriverServer.log

Only local connections are allowed

Sep 19, 2018 4:33:53 PM org.openqa.selenium.remote.ProtocolHandshake createSession

INFO: Detected dialect: W3C

09-19-2018 04:33:53 PM - [RUN_DATA] - Logging run data ‘sessionId’ with value ‘f4d04f6f-50a3-4050-adb0-be4ccb3035bb’

09-19-2018 04:33:53 PM - [RUN_DATA] - Logging run data ‘browser’ with value ‘IE 11’

09-19-2018 04:33:53 PM - [RUN_DATA] - Logging run data ‘platform’ with value ‘Windows 8.1’

09-19-2018 04:33:53 PM - [RUN_DATA] - Logging run data ‘seleniumVersion’ with value ‘3.7.1’

09-19-2018 04:33:53 PM - [RUN_DATA] - Logging run data ‘proxyInformation’ with value ‘ProxyInformation{proxyOption=NO_PROXY, proxyServerType=HTTP, password=, proxyServerAddress=, proxyServerPort=0}’

09-19-2018 04:33:53 PM - [PASSED] - Browser is opened with url: ‘’

09-19-2018 04:33:53 PM - [END] - End action : openBrowser

09-19-2018 04:33:53 PM - [START] - Start action : navigateToUrl

09-19-2018 04:33:54 PM - [INFO] - Checking url

09-19-2018 04:33:54 PM - [INFO] - Navigating to ‘https://www.ratesupermarket.ca/term_life_insurance

09-19-2018 04:34:00 PM - [PASSED] - Navigate to ‘https://www.ratesupermarket.ca/term_life_insurance’ successfully

09-19-2018 04:34:00 PM - [END] - End action : navigateToUrl

09-19-2018 04:34:00 PM - [START] - Start action : setText

09-19-2018 04:34:00 PM - [INFO] - Finding Test Object with id ‘Object Repository/Rates Page 1/Page_Life Insurance Comparison/input_postal_code’

09-19-2018 04:34:00 PM - [INFO] - Checking object

09-19-2018 04:34:00 PM - [INFO] - Checking text

09-19-2018 04:34:00 PM - [INFO] - Checking timeout

09-19-2018 04:34:00 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 04:34:01 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 04:34:01 PM - [INFO] - Clearing text of object ‘Object Repository/Rates Page 1/Page_Life Insurance Comparison/input_postal_code’

09-19-2018 04:34:01 PM - [INFO] - Checking timeout

09-19-2018 04:34:01 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 04:34:02 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 04:34:02 PM - [INFO] - Setting text of object ‘Object Repository/Rates Page 1/Page_Life Insurance Comparison/input_postal_code’ to value ‘M4P1R3’

09-19-2018 04:34:02 PM - [PASSED] - Text ‘M4P1R3’ is set on object ‘Object Repository/Rates Page 1/Page_Life Insurance Comparison/input_postal_code’

09-19-2018 04:34:02 PM - [END] - End action : setText

09-19-2018 04:34:02 PM - [START] - Start action : click

09-19-2018 04:34:02 PM - [INFO] - Finding Test Object with id ‘Object Repository/Rates Page 1/Page_Life Insurance Comparison/button_Get Quotes’

09-19-2018 04:34:02 PM - [INFO] - Checking object

09-19-2018 04:34:02 PM - [INFO] - Checking timeout

09-19-2018 04:34:02 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 04:34:02 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 04:34:02 PM - [INFO] - Clicking on object: ‘Object Repository/Rates Page 1/Page_Life Insurance Comparison/button_Get Quotes’

09-19-2018 04:34:04 PM - [PASSED] - Object: ‘Object Repository/Rates Page 1/Page_Life Insurance Comparison/button_Get Quotes’ is clicked on

09-19-2018 04:34:04 PM - [END] - End action : click

09-19-2018 04:34:04 PM - [PASSED] - Test Cases/Change of X path Tests

09-19-2018 04:34:04 PM - [END] - End Test Case : Test Cases/Change of X path Tests

why do you think button was not clicked? because from logs it seem that Katalon did what you asked - send click on Object: ‘Object Repository/Rates Page 1/Page_Life Insurance Comparison/button_Get Quotes’
what is expected behavior and what do you see?

Once button (Get Quotes) is clicked new page should be uploaded but in this test case even though logs shows button is clicked the new page is not uploaded (this is happening with all my test cases where I have to click on Button)
https://www.ratesupermarket.ca/term\_life\_insurance

Get Quotes Button.JPG

Puneet Sood CNA said:

Once button (Get Quotes) is clicked new page should be uploaded but in this test case even though logs shows button is clicked the new page is not uploaded (this is happening with all my test cases where I have to click on Button)
https://www.ratesupermarket.ca/term\_life\_insurance

This is the page that should be uploaded on clicking

After Clicking.JPG

i wrote simple test and it worked … next page is loading quite slowly, but all good within 30s:

element definitions

and log:

09-20-2018 04:41:45 PM - [START]  - Start Test Case : Test Cases/__Sandbox/RateSupermarket/New Test Case09-20-2018 04:41:45 PM - [INFO]   - Evaluating variables for test case09-20-2018 04:41:46 PM - [START]  - Start action : openBrowser09-20-2018 04:41:46 PM - [INFO]   - Opening browser09-20-2018 04:41:48 PM - [RUN_DATA] - Logging run data 'sessionId' with value 'b6a8f418-56af-4389-8ae5-d74f771cf4d0'09-20-2018 04:41:48 PM - [RUN_DATA] - Logging run data 'browser' with value 'Firefox 52.0'09-20-2018 04:41:48 PM - [RUN_DATA] - Logging run data 'platform' with value 'Windows 7'09-20-2018 04:41:48 PM - [RUN_DATA] - Logging run data 'seleniumVersion' with value '3.7.1'09-20-2018 04:41:48 PM - [RUN_DATA] - Logging run data 'proxyInformation' with value 'ProxyInformation{proxyOption=NO_PROXY, proxyServerType=HTTP, password=, proxyServerAddress=, proxyServerPort=0}'09-20-2018 04:41:48 PM - [INFO]   - Navigating browser to: 'https://www.ratesupermarket.ca/term_life_insurance'09-20-2018 04:41:56 PM - [PASSED] - Browser is opened with url: 'https://www.ratesupermarket.ca/term_life_insurance'09-20-2018 04:41:56 PM - [END]    - End action : openBrowser09-20-2018 04:41:56 PM - [START]  - Start action : verifyElementPresent09-20-2018 04:41:56 PM - [INFO]   - Finding Test Object with id 'Object Repository/__Sandbox/RateSupermarket/input'09-20-2018 04:41:56 PM - [INFO]   - Checking object09-20-2018 04:41:56 PM - [INFO]   - Checking timeout09-20-2018 04:41:56 PM - [INFO]   - Finding web element with id: 'Object Repository/__Sandbox/RateSupermarket/input' located by 'By.xpath: id('postal_code')' in '10' second(s)09-20-2018 04:41:56 PM - [INFO]   - Found 1 web elements with id: 'Object Repository/__Sandbox/RateSupermarket/input' located by 'By.xpath: id('postal_code')' in '10' second(s)09-20-2018 04:41:56 PM - [PASSED] - Object 'Object Repository/__Sandbox/RateSupermarket/input' is present09-20-2018 04:41:56 PM - [END]    - End action : verifyElementPresent09-20-2018 04:41:56 PM - [START]  - Start action : setText09-20-2018 04:41:56 PM - [INFO]   - Finding Test Object with id 'Object Repository/__Sandbox/RateSupermarket/input'09-20-2018 04:41:56 PM - [INFO]   - Checking object09-20-2018 04:41:56 PM - [INFO]   - Checking text09-20-2018 04:41:56 PM - [INFO]   - Checking timeout09-20-2018 04:41:56 PM - [INFO]   - Finding web element with id: 'Object Repository/__Sandbox/RateSupermarket/input' located by 'By.xpath: id('postal_code')' in '30' second(s)09-20-2018 04:41:56 PM - [INFO]   - Found 1 web elements with id: 'Object Repository/__Sandbox/RateSupermarket/input' located by 'By.xpath: id('postal_code')' in '30' second(s)09-20-2018 04:41:56 PM - [INFO]   - Clearing text of object 'Object Repository/__Sandbox/RateSupermarket/input'09-20-2018 04:41:56 PM - [INFO]   - Checking timeout09-20-2018 04:41:56 PM - [INFO]   - Finding web element with id: 'Object Repository/__Sandbox/RateSupermarket/input' located by 'By.xpath: id('postal_code')' in '30' second(s)09-20-2018 04:41:56 PM - [INFO]   - Found 1 web elements with id: 'Object Repository/__Sandbox/RateSupermarket/input' located by 'By.xpath: id('postal_code')' in '30' second(s)09-20-2018 04:41:56 PM - [INFO]   - Setting text of object 'Object Repository/__Sandbox/RateSupermarket/input' to value 'm4p1r3'09-20-2018 04:41:56 PM - [PASSED] - Text 'm4p1r3' is set on object 'Object Repository/__Sandbox/RateSupermarket/input'09-20-2018 04:41:56 PM - [END]    - End action : setText09-20-2018 04:41:56 PM - [START]  - Start action : verifyElementPresent09-20-2018 04:41:56 PM - [INFO]   - Finding Test Object with id 'Object Repository/__Sandbox/RateSupermarket/submitBtn'09-20-2018 04:41:57 PM - [INFO]   - Checking object09-20-2018 04:41:57 PM - [INFO]   - Checking timeout09-20-2018 04:41:57 PM - [INFO]   - Finding web element with id: 'Object Repository/__Sandbox/RateSupermarket/submitBtn' located by 'By.xpath: id('submit')' in '10' second(s)09-20-2018 04:41:57 PM - [INFO]   - Found 1 web elements with id: 'Object Repository/__Sandbox/RateSupermarket/submitBtn' located by 'By.xpath: id('submit')' in '10' second(s)09-20-2018 04:41:57 PM - [PASSED] - Object 'Object Repository/__Sandbox/RateSupermarket/submitBtn' is present09-20-2018 04:41:57 PM - [END]    - End action : verifyElementPresent09-20-2018 04:41:57 PM - [START]  - Start action : click09-20-2018 04:41:57 PM - [INFO]   - Finding Test Object with id 'Object Repository/__Sandbox/RateSupermarket/submitBtn'09-20-2018 04:41:57 PM - [INFO]   - Checking object09-20-2018 04:41:57 PM - [INFO]   - Checking timeout09-20-2018 04:41:57 PM - [INFO]   - Finding web element with id: 'Object Repository/__Sandbox/RateSupermarket/submitBtn' located by 'By.xpath: id('submit')' in '30' second(s)09-20-2018 04:41:57 PM - [INFO]   - Found 1 web elements with id: 'Object Repository/__Sandbox/RateSupermarket/submitBtn' located by 'By.xpath: id('submit')' in '30' second(s)09-20-2018 04:41:57 PM - [INFO]   - Clicking on object: 'Object Repository/__Sandbox/RateSupermarket/submitBtn'09-20-2018 04:42:02 PM - [PASSED] - Object: 'Object Repository/__Sandbox/RateSupermarket/submitBtn' is clicked on09-20-2018 04:42:02 PM - [END]    - End action : click09-20-2018 04:42:02 PM - [START]  - Start action : verifyElementPresent09-20-2018 04:42:02 PM - [INFO]   - Finding Test Object with id 'Object Repository/__Sandbox/RateSupermarket/p_Life Insurance'09-20-2018 04:42:02 PM - [INFO]   - Checking object09-20-2018 04:42:02 PM - [INFO]   - Checking timeout09-20-2018 04:42:02 PM - [INFO]   - Finding web element with id: 'Object Repository/__Sandbox/RateSupermarket/p_Life Insurance' located by 'By.xpath: //p[text()='Life Insurance']' in '30' second(s)09-20-2018 04:42:03 PM - [INFO]   - Found 1 web elements with id: 'Object Repository/__Sandbox/RateSupermarket/p_Life Insurance' located by 'By.xpath: //p[text()='Life Insurance']' in '30' second(s)09-20-2018 04:42:03 PM - [PASSED] - Object 'Object Repository/__Sandbox/RateSupermarket/p_Life Insurance' is present09-20-2018 04:42:03 PM - [END]    - End action : verifyElementPresent09-20-2018 04:42:03 PM - [PASSED] - Test Cases/__Sandbox/RateSupermarket/New Test Case09-20-2018 04:42:03 PM - [END]    - End Test Case : Test Cases/__Sandbox/RateSupermarket/New Test Case

image.png

image.png