Validate Login

I am doing Automation on Booking Services where I need to click first on Booking button then it redirect to Login page and put user credential after successful login user will redirected to Booking continue page. But unfortunately after login I am redirected to Search page also I am not showing login with that credential. So I have doubt that Login is not done successfully. Now My question is how can I validate the login credential so that it will track user is logged in or not. looking for urgently help.

try to use debug mode with breakpoints strategically set so you can see what’s going on with your test

Hi Andrej,

Thanks for your quick reply. I have used debug mode with breakpoints but faces some errors which says class files missing exceptions. Here are the screenshots please go through it. Also Early reply will be appreciated as I am stuck on the beginning of the project.

Screenshot_1.png

1 Like

Did not seen anything like that :frowning:

1 Like

Please, forget the debugger right now – it’s just a distraction. Let’s proceed slowly…

1 - Write a test case with one simple aim: Click the Booking button.

Does that work? Do you get errors? What are they?

2 - Next, ADD the lines to the test to enter the user credentials and login.

Does that work? Do you get errors? What are they?

Please provide as much information as you can. Show us the HTML, any errors you have and any screenshots you think might help.

Good luck.

Russ Thomas said:

Please, forget the debugger right now – it’s just a distraction. Let’s proceed slowly…

1 - Write a test case with one simple aim: Click the Booking button.

Does that work? Do you get errors? What are they?

2 - Next, ADD the lines to the test to enter the user credentials and login.

Does that work? Do you get errors? What are they?

Please provide as much information as you can. Show us the HTML, any errors you have and any screenshots you think might help.

Good luck.

Russ Thomas said:

Please, forget the debugger right now – it’s just a distraction. Let’s proceed slowly…

1 - Write a test case with one simple aim: Click the Booking button.

Does that work? Do you get errors? What are they?

2 - Next, ADD the lines to the test to enter the user credentials and login.

Does that work? Do you get errors? What are they?

Please provide as much information as you can. Show us the HTML, any errors you have and any screenshots you think might help.

Andrej Podhajský said:

Did not seen anything like that :frowning:

Russ Thomas said:

Please, forget the debugger right now – it’s just a distraction. Let’s proceed slowly…

1 - Write a test case with one simple aim: Click the Booking button.

Does that work? Do you get errors? What are they?

2 - Next, ADD the lines to the test to enter the user credentials and login.

Does that work? Do you get errors? What are they?

Please provide as much information as you can. Show us the HTML, any errors you have and any screenshots you think might help.

Good luck.

Thanks Andrej and Russ for your help, Russ, I am not getting any error. All test cases have been passed without any failure. I have checked all my log file and console.
I will upload log file and screenshots later but currently I have not been able to debug the file due to missing some class file so I uninstall the tool and install again. So it will take few times.
In the mean time, can you please tell me is there any possibility of failure of my script without showing failure test cases result generated on log file and console? I have tried all the possible way to overcome the failure still its redirected to search page :frowning: :frowning: Please help

Ok, just quick checklist make sure
- there is only one open browser fn() in TC
- you are actually waiting after login submisson for page to load
- if in doubt, call fn to make screenshot to see what Katalon is looking at
- you are using waitforcomponent functions before access components of page (if needed)
- take your time and study console output to see what is going on in detail

1 Like

From your description, this seems very strange (and that’s why Andrej asked you to be certain you only have one opened browser).

We need to see the HTML you are targeting. Because looking at your description of what is happening doesn’t make any sense. There is clearly something very different about using your website by hand (as a normal user) and what happens when you run your tests. Figuring out what that difference is by telepathy or osmosis is one step beyond impossible.

Show us your HTML.

1 Like

i had once something similar directly after login i used navigateTo() but since response from login did not come fast enough, technically i was not logged in - i was redirected somewhere else … but i cannot remember for 100% it was long time ago…
as Russ write, we need more detailed info to be able to help you.

1 Like

Andrej Podhajský said:

i had once something similar directly after login i used navigateTo() but since response from login did not come fast enough, technically i was not logged in - i was redirected somewhere else …

That was my thought too.

Nazneen, you must send us your test case steps and a copy of the HTML elements involved.

Hi Russ and Andrej, I really appreciate your quick response and thanks for your support :slight_smile:
The problem was very strange as I uninstall the tool and install it again the problem resolved. But my main question is if it may occur in future then after writing lots of code how can I uninstall it? Is there any way to handle such ambiguous situation?
My second question is How can I debug my problem? I am totally new in programming and just have basic java and c knowledge. I have found very basic topic on debugging on different sites which could not help me. So kindly guide me in detail.

Thanks

i can just write what i do in case i run in some problem:
1. carefully read exception (if received)
2. carefully read console log
3. check for my own typos in xpath, code, anywhere
4. use google to look for answer
5. read documentation again to see if i missed something
6. use brak-points in debug mode to see what’s going on
7. search on forum
8. ask on forum

4 Likes

I’ll add a few things to what Andrej said (and all of the things he said get my vote too).

9 - “It aint what you don’t know, it’s what you think you know that aint so.” For those whose mother tongue is not English, let me explain that…

Frequently, we think something is caused by X. We build upon this false X, and only later, after many, many hours (days?) we discover X was NOT true in the first place. We think we are going wrong because of something we don’t know, when in actual fact our problem is caused by a faulty assumption, something we thought we knew, which was NOT true.

So, check everything and make no assumptions.

10 - Use a binary approach to problem solving:

Split the problem into two parts. Now see if the problem is evident in Part A or Part B. If it’s in part A, split A into two parts. Repeat. Repeat until you have the problem and its cause staring you in the face.

In programming, you will end up with one faulty line of code (hopefully). In electronics, you will end up with one faulty component, etc.

11 - There is no golden rule.

12 - See 11 :wink:

Finally, let me re-emphasize Andrej’s rule 5. But don’t assume the documentation is always correct – especially online. It’s written by humans. Humans make mistakes. Don’t we B)

Finally, finally, I don’t believe 100% the re-install fixed the problem. Hopefully, I’m wrong. I frequently am B)

4 Likes

Thanks Andrej and Russ, I will definitely follow your instruction. But again stuck in new one. Please help. I have shared a screenshots with you.

Screenshot_1.png

From the above screenshots, I wants to select any date from the date picker, then text box appear to add time, by clicking on that text box start time and end time drop down button will be pop up.So I wants to select start time from that drop down then end time will be taken automatically.
My Test steps are :

  1. select start date from the date picker
  2. Click on “wants to add time” Text box then start time and end time drop down will appear
  3. select start time from the drop down then end time will be automatically pick up.

I have attached HTML file. Please guide me based on above scenario. As I am beginner so step by step instructions will be helpful for me :slight_smile:

Thanks

html.zip

nazeen, and what is the problem?

Date picker is not working. also "I wants to add time " text box is not clickable :frowning:
I have search a lot but not found proper solution.

Here is the error result:
Test Cases/Booking Services for Customer FAILED because (of) groovy.lang.MissingMethodException: No signature of method: static com.kms.katalon.core.testobject.ObjectRepository.findTestObject() is applicable for argument types: (java.lang.String, com.kms.katalon.core.model.FailureHandling) values: [Object Repository/Booking Services/a_Want to add time, STOP_ON_FAILURE]

Possible solutions: findTestObject(java.lang.String), findTestObject(java.lang.String, java.util.Map)

I have written several codes for data picker, found on net but all is in vein So I left the date picker part and concentrate only on “wants to add time” which is also not working :frowning: Please help. As this booking part is very essential for my project.

Okay So when I write date picker code its showing me this error:

Test Cases/Booking Services for Customer FAILED because (of) Unable to set text ‘06 July 2018’ of object ‘Object Repository/Booking Services/input_start_date’ (Root cause: org.openqa.selenium.InvalidElementStateException: invalid element state: Element must be user-editable in order to clear it.

(Session info: chrome=67.0.3396.99)

(Driver info: chromedriver=2.35.528161 (5b82f2d2aae0ca24b877009200ced9065a772e73),platform=Windows NT 6.3.9600 x86_64) (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: ‘WINCTRL-I1MBNJ3’, ip: ‘192.168.0.56’, os.name: ‘Windows 8.1’, os.arch: ‘amd64’, os.version: ‘6.3’, 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\ASSET-~1\AppData\L…}, 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: 67.0.3396.99, webStorageEnabled: true}

Session ID: cfd7f8509f06cdb5e77f8fe3beea5253)

And here is my code for date picker and add time:

WebUI.setText(findTestObject(‘Object Repository/Booking Services/input_start_date’), ‘06 July 2018’ )

WebUI.click(findTestObject(‘Object Repository/Booking Services/a_Want to add time’, FailureHandling.STOP_ON_FAILURE))

WebUI.selectOptionByValue(findTestObject(‘Object Repository/Booking Services/input_start_date’), ‘02:00 PM’, false)

WebUI.click(findTestObject(‘Object Repository/Booking Services/a_next step’))

nazneen said:

Here is the error result:
Test Cases/Booking Services for Customer FAILED because (of) groovy.lang.MissingMethodException: No signature of method: static com.kms.katalon.core.testobject.ObjectRepository.findTestObject() is applicable for argument types: (java.lang.String, com.kms.katalon.core.model.FailureHandling) values: [Object Repository/Booking Services/a_Want to add time, STOP_ON_FAILURE]

Possible solutions: findTestObject(java.lang.String), findTestObject(java.lang.String, java.util.Map)

I have written several codes for data picker, found on net but all is in vein So I left the date picker part and concentrate only on “wants to add time” which is also not working :frowning: Please help. As this booking part is very essential for my project.

It seems you are trying to add FailureHandling to WebUI.click() and click() only excepts Test Object as input.