How to get the login challenge using Robot Framework

863 views
Skip to first unread message

Nagaraj Hebbar

unread,
Jul 3, 2019, 7:47:44 AM7/3/19
to robotframework-users
Hi All,
           Our application built on a "Open Source OAuth 2.0".How to get the login_challenge using the Robot Framework simple URL looks like below 
         {DomainName}/uas/portal/auth/login?login_challenge=c29d71cc5e704eb28973fab436c4b1ac

Shiva Prasad Adirala

unread,
Jul 3, 2019, 8:40:16 AM7/3/19
to robotframe...@googlegroups.com
Using String library keywords you can fetch respective content from location. Following is the sample snippet for you

*** Settings ***
Library SeleniumLibrary
Library String

*** Variables ***

*** Test Cases ***
Get Login Challenge
Open Browser ${my_website} chrome
# assumes page redirected to your custom page i.e, <domain>/uas/portal/auth/login?login_challenge=c29d71cc5e704eb28973fab436c4b1ac
${redirected_url}= Get Location
# get login_challenge from ${redirected_url} using String library keyword
${login_challenge}= Fetch From Right ${redirected_url} ?login_challenge=
Log To Console \n${login_challenge}

Nagaraj Hebbar

unread,
Jul 3, 2019, 10:02:28 AM7/3/19
to robotframework-users
Hi Shiva,
                Thanks for the reply but the things are not working as expected i have attached the test case and the result file also. Once the automation script runs it has to give me the login_challenge(attached screen shot) that is not happening in while running the automation test case.Please let me where i went wrong. 
LoginChallenge.zip

Shiva Prasad Adirala

unread,
Jul 7, 2019, 2:01:23 AM7/7/19
to robotframe...@googlegroups.com
Problem: I have observed that issue with application URL redirect issue

Solution: Change in application URL (use only domain name) will redirect us to login page URL which consist of login_challenge

Please find the attachment for working code
google.robot

Nagaraj Hebbar

unread,
Jul 8, 2019, 6:06:03 AM7/8/19
to robotframework-users
Thanks Shiva for your help it got worked...
Reply all
Reply to author
Forward
0 new messages