Cannot take screenshot during running a test case

If my understanding is NOT correct regarding using the user name and password, then how can I be able to enter my user name and password during the run time???

That’s what we’re trying to resolve :wink:

I added the breakpoint on the line WebUI.click(findTestObject(‘Object Repository/folder10/input_Password_btn btn-default hidden-xs’))

and here is what I get

and the FF browser

And what happens if you click “Sign In” manually at this point?

once I click sign in manually, it gives me the following screen

Ok we’re getting closer. I suspect that the implementation of the WebUI.setEncryptedText() method is not working as intended for your field. Please try this approach instead of the WebUI.setEncryptedText() method:

import com.kms.katalon.util.CryptoUtil

CryptoUtil.CrytoInfo cryptoInfo = CryptoUtil.getDefault('vhY2RXFFBgI=')
String rawText = CryptoUtil.decode(cryptoInfo)
WebUI.sendKeys(findTestObject('Object Repository/folder01/input_Password_password'), rawText)
1 Like

There’s a “tip in waiting” if ever I saw one. Thanks Brandon.

1 Like

That’s assuming that we get it working :crossed_fingers:t3: We’ll see…

I meant the alternative crypto lib. Good to know!

whispers quietly*: I just ripped it from the source for the source for the keyword… Don’t tell anyone :shushing_face:

I have no idea WHAT you’re talking about… (whistling cheerfully, he walks away…)

1 Like

Brandon,
This is the default setup, Is it Correct?

Yes, that is the default. I’m not sure whether that setting will affect what you’re trying to do.

replacing the line
WebUI.setEncryptedText(findTestObject(‘Object Repository/folder10/input_Password_password’), ‘vhY2RXFFBgI=’)
by
CryptoUtil.CrytoInfo cryptoInfo = CryptoUtil.getDefault(‘vhY2RXFFBgI=’)
String rawText = CryptoUtil.decode(cryptoInfo)
WebUI.sendKeys(findTestObject(‘Object Repository/folder10/input_Password_password’), rawText)

Did not fix any thing

Wow, then I’m really stumped…

Ok please run this again in debug, with the same breakpoint as before, and confirm the following for me:

1.) When the script pauses at the breakpoint, Katalon should switch you to the Debug perspective, if you aren’t there already:

image

In the debug perspective, you should see a “Variables” tab somewhere, probably next to the Console:

image

Click on that tab, and then click on the “rawText” row, and tell me what value you see for that variable. It should match the actual (decrypted) password of “158503”.

2.) In your browser, after the value is entered in the field and the script has paused, please right click on the field and click “Inspect”, then take a screenshot of the HTML for the field. The element in question is probably an <input> element.

rowText value is my password correct

My FF Browser

Ok, so we know that your code is putting the correct password into the correct field for sure. That takes care of the first item. Now for the second item, can you please take a screenshot of that same HTML element, but after you’ve entered the password manually, without using Katalon at all. I’m trying to see if the JavaScript for the page is actually capturing the keystrokes that Webdriver is simulating.

Without Using Katalon at all. Katalon is not running on my laptop now.

User Name inspect element

Password inspect element

Ahmed

I’ll defer to Brandon, of course, but since he seems to not be around right now, I want to point out something I noticed while studying your images.

In the last image, where you were capturing the workflow when the site was operated manually, there is an event wired up to the control. Firefox shows this as a small button ‘event’ in the Inspector next to the control.

In the earlier image, where you were operating the app via Katalon and had set a breakpoint, there is no evidence the same control has an event handler attached. This is likely very significant.

If the following is how your code looks now…

WebUI.setText(findTestObject(‘Object Repository/folder01/input_User Name_username’), ‘ff_as’)

WebUI.setEncryptedText(findTestObject(‘Object Repository/folder01/input_Password_password’), ‘vhY2RXFFBgI=’)

then please add some delay – perhaps ensuring your elements are “ready”. You might also try a fixed (very silly) delay just to see if we’re on the right track:

WebUI.delay(5)

WebUI.setText(findTestObject(...), ‘ff_as’) 

WebUI.setEncryptedText(findTestObject(...), ‘vhY2RXFFBgI=’)

Let us know how you get on.

1 Like

In addition, you could let us know what the event contains (click it and try to capture the event handler content).