cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Frequent Visitor

UI flow login issue

Hello!

 

 

On this website https://docs.microsoft.com/en-us/power-automate/ui-flows/create-web it says:

Temporary user profile for playback

Selenium IDE recordings are done with the current user's profile, but playback is done using a temporary user profile. This means that websites that need authentication may not ask for credentials during a recording session, but the authentication steps will be needed during playback.

To address this, the user needs to manually edit the script to insert the commands needed for the login process.

I am struggling exactly with this. 

 

After building my webapp flow, I tested everything in Selenium IDE where things work perfectly. 

I even made sure that I am logged out from any website/application when I recorded my webapp flow. 

In other words, my web app tests open a website where Selenium logs in and then executes the steps. 

So far so good. 

 

Problem:

If I add my web app flow into a normal one then the login does not work. 

There seems to be a refresh of the login page and things get stuck immediately. 

 

Can somebody provide some hints how to overcome this issue?

 

Thanks,

Badal

7 REPLIES 7
Highlighted
Microsoft
Microsoft

Re: UI flow login issue

Hi @Badal,

Could you give more detail about the issue during flow execution? What do you mean by "a refresh of the login page"? This issue is tightly related to your website, so the solution will vary depending on the problem you face. Maybe the URL you're trying to reach isn't the right one when you're not signed in, so you're being redirected?

Indeed, as you said, the recording can be different from the playback as the playback is performed on a fresh browser profile, so the behavior may not be the same. If you want to record in the same conditions, you have to delete all the cookies/session/cache of your browser (you can use a different supported browser if you don't want to lose your data, like Edge if you're using Chrome).

 

Best regards,

Highlighted
Frequent Visitor

Re: UI flow login issue

Hi @WSH ,

 

I have a task in which I need to login to a site and work on it. I have created a flow and when I run it through selenium IDE, there is no authentication pop up but while I call it in power automate and test the flow from there, the authentication pop up exist while the site is loading and I need to manually enter the login credentials every time I run the flow. 

 

In this site:

https://docs.microsoft.com/en-us/power-automate/ui-flows/create-web#limitations-and-known-issues-for...

 

It says it's a limitation so the user needs to manually edit the script to insert the commands needed for the login process.

Can you please let me know which commands I need to insert in order to login?

 

 

Thanks,

Badal

 

 

Highlighted
Microsoft
Microsoft

Re: UI flow login issue

Hi @Badal,

Indeed, this behavior is expected as you are recording using your browser, which is probably already logged into the website, that's why you're not having the authentication popup during the recording. During the playback though, Selenium launches a fresh browser session to have a reproducible execution environment, so it needs to include the login steps in the recording.

The commands you have to insert in your script depends on your website, because all websites are different and have their custom login pages, that's why I cannot tell you which commands to add in your specific case.

So you have 2 possibilities:

  • Either you edit the script yourself and insert manually the commands needed to log into the website. These commands should be added at the position in the script where the login popup is visible (so probably at the beginning, before the first failing action). You can find a few information on how to do that there: https://docs.microsoft.com/en-us/power-automate/ui-flows/edit-web . You will probably only need to add "click" and "send keys" commands (to respectively click somewhere in the page and type something on the keyboard).
  • Or either you record your script again, which is probably the easiest solution. You need to make sure that the recording includes the login steps this time. To do so:
    • log out from the website, and clean all your cookies, cache, session information in your browser. Then make sure that it's working by going to the website and validate that you see the same popup as during the playback, then you can record the script again.
    • if you don't want to delete your data from your browser, try to use a different browser that you don't usually use to reach this website and validate that you see the authentication popup in your website. If that's the case, then record the script again using this browser.

Hope it helps 🙂

Best regards,

Highlighted
Frequent Visitor

Re: UI flow login issue

 
Highlighted
Frequent Visitor

Re: UI flow login issue

Hi @WSH ,

I have already done the steps you provided. To be more precise, when I record the steps through Selenium and when there is pop up for authentication,it stops recording at that point and when I enter the credentials and after logging into the site, it again starts recording. And when I test the flow in selenium again then it directly login to the web app. But when I call it in power automate and test it then It is asking for credentials every time I run the flow through power automate.

I have also tried to get the Xpath at the point of pop up but there is no inspect option while I right click on the pop up. I already used the 'Send Keys' command but It is unable to locate. 

 

I have also tried to enter my username and password inside the URL in this format (https://Username:Password@powerusers.microsoft.com/ )

It worked in selenium IDE but I am getting the same issue while testing it through power automate.

I need to enter the credentials manually every time I test the flow through power automate

 

 

Thanks,

Badal

Highlighted
Microsoft
Microsoft

Re: UI flow login issue

I see, actually with the authentication method your website is using, the login popup is displayed and handled by the browser, and not by the website itself. Selenium only have access to the website and that's why it cannot record the authentication steps.

As you mentioned, you have to put your credentials in the URL itself to be able to solve this issue.

I just tested it myself and I'm able to record and run a flow with this type of authentication. Here are the steps I took:

  • Create a new Web UI flow and put the URL of your website without the credentials. We currently have an opened bug on that (you cannot create the UI flow with a URL of format user:password@website.com).
  • In Selenium IDE, change the target URL to include your credentials:
    WSH_0-1593606426678.png

     

  • Record your script. As you put your credentials in the URL just before, you should not be prompted for credentials. If that's the case, your credentials must be wrong, stop the recording, double check your credentials and restart the recording from the beginning.
  • Then save your recording. Once saved, edit this recording and make sure that Selenium IDE still displays the URL with your credentials.
  • If that's the case, just close the IDE and use the UI flow as usual in your Flow, it should work.

Does it work for you following my steps?

 

Alternatively, you can try recording your script with WinAutomation instead of Selenium. Now that Softomotive is part of Power Automate, you can directly use the WinAutomation Web recorder in UI flows. Here is a link to help you get started: https://docs.microsoft.com/en-us/power-automate/ui-flows/create-processes

 

Best regards,

Highlighted
Frequent Visitor

Re: UI flow login issue

Hi,

 

I will go ahead and install the WinAutomation and try to record the script.

 

I hope that would help resolving this issue

Thanks for being precise.

Appreciate your help.

 

Regards,

B

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

Tech Marathon

Maratón de Soluciones de Negocio Microsoft

Una semana de contenido con +100 sesiones educativas, consultorios, +10 workshops Premium, Hackaton, EXPO, Networking Hall y mucho más!

Users online (6,065)