How can I integrate setHttpHeaderProperties into katalon? I’m afraid I’m new to this, so I don’t see how to do it. I’ve searched the doco, and google several times without luck.
I want to call it to set up a few parms before running some tests.
Any suggestions would be much appreciated!
Thanks from down under.
What is “setHttpHeaderProperties” you mean?
I don’t know it at all.
It’s a routine that allows me to set an HTTP header. e.g.
‘Create new ArrayList’
ArrayList HTTPHeader = new ArrayList()
‘Send token in HTTP header’
HTTPHeader.add(new TestObjectProperty(‘Authorization’, ConditionType.EQUALS,‘user’))
‘Set that token’
‘Get response text’
response = WS.sendRequest(RO)
I copied this from another question, but don’t know how to integrate it into katalon.
What is this
I do not know anything called
RequestObject in the “Web Testing” domain in Katalon Studio.
Do you know its fully-qualified-class-name?
I am confused.
You posted this question into the “Web Testing” category.
com.kms.katalon.core.testobject.RequestObject is only used for the “API Testing”, is not meant for “Web Testing”.
Which of them — “Web Testing” & “API Testing” are you going to perform?
In other words, do you want to use “WebUI.openBrowser()” and “RequestObject” together?
Ah, good question! I’m doing a web browser test, and want to set that http header. I have no idea if I’m on the right track or not!
I noticed that there is a previous topic similar to this, and
@Brandon_Hein already provided an answer:
and you appended a post to it
Sorry, that’s WAY more complex than I can handle, being a newbie to katalon.
Surely we can just add half a dozen lines of code after WebUI.openBrowser? Or something like that?
Thanks in advance!
I think that the Brandon’s answer is valid and most appropriate. You should try to understand it.
I looked at his answer, and downloaded the code. It’s an entire server, and far far more than I can deal with! Why can’t I use use half a dozen lines of code? I don’t want to install a whole server, and have to figure out what it does, and why. That’s massive overkill!
Surely a simple question doesn’t need an entire server?!
Yes. Your requirement is more complex than you expect.
The way Brandon suggested requires a server and is proven to work for Selenium users.
I guess, but not verified, that there would be alternative method if your script make use of Chrome DevTools Protocol.
That’s amazing. So now I need to masterjava, groovy, katalon, and another server. And I thought katalon would make things easy to test
Yes, you are right. As long as your test script uses Selenium WebDriver to communicate with browsers (in Katalon Studio you do).
Katalon has its own capability, but is not almighty.
It seems that a test script in
puppeteer and playwright will communicate with browsers using Chrome DevTools Protocol (CDP for short). CDP enables your test script to add custom headers in the HTTP request from browser to server. Why not you try them?
If you are going to spend your time to learn something new to you, then learning CDP + Playwritht in Typescript would be more interesting than struggling with the “entire server”.
Sounds promising, I’ll have a look. Thanks for all your help, it’s appreciated!
BTW, nice cat. I adore cats