Can you help me on this how can i capture transit URL info?. really want to wind up the automation manual token info generation.
Hi @gopabandhu.patra,
Instead of using WebUI.getUrl(), can you try WebUI.executeJavaScript(āreturn window.document.referrerā, null) to get the immediate URL?
WebUI.click(findTestObject(āObject Repository/Page_Sign In/span_Sign inā))
String redirectUrl=WebUI.executeJavaScript(āreturn window.document.referrer;ā, null)
println āORIGINALā¦ā+redirectUrl
Did it but it is not capturing transit URLā¦
Any response please??
Hi @gopabandhu.patra,
Can you share a video that capture the automation process to login for OAuth2 access token?
ScreenRecorderProject2.zip (3.3 MB)
here you go
any response please?
Hi @gopabandhu.patra,
I suspect that the developers of your site may store some valuable information in the cookies. You should perform the steps to login again and when the last page shows up, please inspect the site cookies to see if there is something that helps.
I can see the token while inspecting and can collect manually. How can i collect that element/value from katalon?
Hi @gopabandhu.patra,
You mean that you see the token from the cookies?
Hi @gopabandhu.patra,
In the automation code, can you invoke DriverFactory.getWebDriver().manage().getCookies() and share the String representation of the cookies?
[_gat=1; expires=Tue, 11 Aug 2020 02:23:13 SGT; path=/; domain=.petronas.com, _ga=GA1.2.2049607677.1597126934; expires=Thu, 11 Aug 2022
02:22:13 SGT; path=/; domain=.petronas.com, ai_user=pLVEt|2020-08-11T06:22:13.931Z; expires=Wed, 11 Aug 2021 02:22:13 SGT;
path=/; domain=qamyevents.petronas.com;secure;, ai_session=va3k/|1597126933934.02|1597126933934.02;
expires=Tue, 11 Aug 2020 02:52:13 SGT; path=/; domain=qamyevents.petronas.com;secure;,
ARRAffinity=1ae70d8f3a94ece05432e731b2706b3e697429b7036c866aeece4fc215a521df; path=/;
domain=.qamyevents.petronas.com, G_ENABLED_IDPS=google; expires=Fri, 31 Dec 9999 08:00:00 SGT;
path=/; domain=.qamyevents.petronas.com, _gid=GA1.2.1585004102.1597126934; expires=Wed, 12 Aug 2020 02:22:13 SGT; path=/; domain=.petronas.com]
anything???..am struggling
Hi @gopabandhu.patra,
Iām afraid that we cannot proceed with this solution, as there is no official method to get the intermediate URL with Selenium. Can you ask your developers if they support Refresh Token grant type, and if yes, how long that refresh token is valid? If we have that information, maybe we will try another way.
How can postman get the information by giving Implicit grant type?
Hi @gopabandhu.patra,
Can you share a video how you get an access token with Postman?
pfaā¦123.zip (1.9 MB) pfa is the steps postman follows
Hi @gopabandhu.patra,
I have attached new version of the project I sent last time. In this version, I use Selenium WebDriverWait to help capture the intermediate URL. Remember that you have to set the pageLoadStrategy to ānoneā in Desired Capabilities settings, and the browser you use should be Chrome.
Many thanks⦠got it the tokenā¦