''' *** Keywords ***
check ztrass url session
[Arguments] ${server}
${session_id}= Browsersession ${server}// by this local default browser is opened and we copy this url
${url}= Set Variable "${session_id}"
${url_state}= Run Keyword And Continue On Failure check_url ${url}
${sesionURL}= check_Sessionurl ${url_state}
[Return] ${url} ${sesionURL} ${url_state}
Verify to Okta steps
[Arguments] ${url}
${url_state}= check_url ${url}
log ${url_state}
${Options}= Evaluate sys.modules['selenium.webdriver'].ChromeOptions() sys, selenium.webdriver
Call Method ${Options} add_argument --lang=en
# Call Method ${Options} add_argument --headless
Call Method ${Options} add_argument --ignore-certificate-errors
Call Method ${Options} add_argument --allow-running-insecure-content
Create WebDriver Chrome options=${Options}
Set Window Size 1200 720
maximize browser window
#Delete All Cookies
Go To ${url_state}
#open browser ${url_state} Chrome
Login to Okta
sleep 10
Verify OTP
def Browsersession(variable):
command = 'ssh -F C:/pomerium/config {} -D 8080'.format(variable)
print(command)
child = pexpect.run(command, timeout=20)
print("get_url", child)
return child
Verify OTP
[Documentation] This Keywords is Enter the OKTA authentication OTP
${otp} Get Authentication Code ${securityKey}
Click Element ${inputLoc}
input text ${inputLoc} ${otp}
Log ${otp}
capture page screenshot
Wait Until Element Is Visible ${signINBtn} ${waitTime}
Click Element ${signINBtn} # after clicking it will redirect to page with same port that we fetched from URL and its will show login completed.
Sleep 5
capture page screenshot
'''
** Issue:
But after verifying otp its showing site can’t reached because its opening different port. ,only issue on macos ,in windows machine its working fine ***
Through 1st browse session , default browser is opened ,and by fetching that URL I am using in selenium browser but why after verifying otp ,why its redirected to differnt port.
and showing site can’t be reached, I am doing OKTA verification automation in macos, in windows maching its working fine