I was able to set a Cookie But When I checked login mechanism, I found that I should be setting key in the 'Local Storage'
Below is code for same:
Successful Login
Create Session loginsession url=${base_url} verify=true
${data} Create dictionary grant_type=password username=${username} password=${password}
${headers} Create Dictionary Content-Type=application/x-www-form-urlencoded authorization=${authorization}
${resp} POST On Session loginsession /oauth/token params=${data} headers=${headers}
${access_token} Get Value From Json ${resp.json()} $.access_token
Launch browser and maximize it ${browser}
Add Cookie token ${resp.json()} domain=qa.mycrm.com
Agent lands on My CRM Login Page
Go To https://qa.mycrm.com/dashboard/
I am seeking help on how can i set a key in browser's Local Storage
CodePudding user response:
Did you try importing Seleniumlibrary and use Execute Javascript?
Execute Javascript window.localStorage.setItem("abc", "SaHlOcAhIeBmy")