microsoft / EasyRepro

Automated UI testing API for Dynamics 365
MIT License
521 stars 288 forks source link

Getting Powerapps cookie error after navigating to the app #1252

Open AddalaDeviPriya opened 2 years ago

AddalaDeviPriya commented 2 years ago

Getting the below cookie error after navigating to the app while running the test Tried allowing third party cookies in browser settings but still the error occurs for every new session created while running the tests. Is any option need to be changed in the code to get rid of this error?

image

thathi commented 2 years ago

I think you may need to update the settings as suggested in the following link. https://docs.microsoft.com/en-gb/powerapps/troubleshooting-startup-issues#enable-storage-of-third-party-cookies-and-local-data-in-your-browser-or-app

AddalaDeviPriya commented 2 years ago

I think you may need to update the settings as suggested in the following link. https://docs.microsoft.com/en-gb/powerapps/troubleshooting-startup-issues#enable-storage-of-third-party-cookies-and-local-data-in-your-browser-or-app

@thathi Already tried and this is not working for the new session

Shakevg commented 2 years ago

@AddalaDeviPriya Try set CookieСontrolsMode to 0 More info on how to enable third-party cookies Example bellow.

BrowserOptions SharedOptions = new BrowserOptions
{
    CookieСontrolsMode = 0
};
var _webClient = new WebClient(SharedOptions);
AddalaDeviPriya commented 2 years ago

@Shakevg Tried setting CookieСontrolsMode = 0 and Third Party cookies are enabled. But when this value is set to zero, App is asking for MFA. How to bypass this phone OTP authentication?

image

Shakevg commented 2 years ago

@AddalaDeviPriya How does it work if you enable cookies manually (screen below) when you start the browser manually? Is it required to sign in too? I just handled this case by implementing a click to the sign-in button if dialog appeared. image

AddalaDeviPriya commented 2 years ago

@Shakevg I manually changed my browser settings to allow all cookies and tried login to the app. It still asks for Sign in with OTP. I am not getting this sign in OTP if CookieСontrolsMode = 1.It only pops up powerapps error. MFA appears when the value is set to 0. Looks like MFA is dependent on this key. Is there a way to handle this?

Shakevg commented 2 years ago

@Shakevg I manually changed my browser settings to allow all cookies and tried login to the app. It still asks for Sign in with OTP. I am not getting this sign in OTP if CookieСontrolsMode = 1.It only pops up powerapps error. MFA appears when the value is set to 0. Looks like MFA is dependent on this key. Is there a way to handle this?

@AddalaDeviPriya I suppose you should work with dev team to undestand how end user will work with it, becuase looks like it is not related with framework