Any possibilities to pass additional headers in use browser activity

For Retail Link website, we have an update in login process to access the website using bot user accounts (specifically created to perform automations). As a part of this, a bot access token is generated for these accounts, and needs to be passed (as a header) at the time of login along with the bot-account credentials. We are having trouble implementing it in a browser - as we only have Input fields to enter username and password in the login page, and we are not sure where this token can be passed. Any thoughts on this please.

https://supplierhelp.walmart.com/s/guide?article=000010807#Log_in_to_RL_with_Bot_Account

2 Likes

Hi @gowtham.jayavel - It looks like you have to use APIs to pass this token. You might have to use HTTP request activities. Check the below link

https://docs.uipath.com/activities/other/latest/user-guide/http-client

@ushu Thanks for the response, actually this is UiAutomation use case and we are trying to find the solution to the manipulate/add an additional header to the http request made during the UI Interaction.

keep in mind, that the shared guide is mentioning a POST method. Using an UiAutomation e.g. open URL os more about using a Get Method.

Maybe a custom / own hosted HTML Form offered for the UiAutomation can do the bridge by sending the needed info by a post and then let take over the UiAutomation to further work with (Use Browser/Attach Browser)

Hi, Did you find a solution to this? I have the same problem. I just got a bot account, I’m able to authenticate, but I can’t get any further.

Appreciate any input you may have.
Thank you

You can have a look at this thread. It might be helpful.

For wb.Navigate you try to use Navigate activity. Though I am not sure how much helpful it would be.

Below is quoted text from the thread

With help from this question, I dropped a hidden WebBrowser control on my form, and then launched the URL in an external browser, with Authorization header, as follows…

' wb is the WebBrowser 
Dim hdr = "Authorization: Basic " & Convert.ToBase64String(Encoding.UTF8.GetBytes("EncodedInfoHere".ToCharArray()))
wb.Navigate(url & unm, "_blank", {}, hdr)
1 Like

Hi @gowtham.jayavel !
Did you manage to solve this problem? We’re facing the same issue.

Hi @gowtham.jayavel and @Marta! Not sure if it’s the best/more correct solution, but I was able to make the login by updating the website (Retail Link) cookies with the set-cookie information on the POST request response headers and then moving to the homepage (Retail Link).

this is the set-cookie information on response header:

Please find an example atached. Just update the x-bot-token, username and password on the Arguments section

teste-login-walmart.1.0.1.nupkg (12.8 KB)

1 Like

Hi ,
Thanks for sharing. Your solution worked for me But after deploying in production i am getting this error Get Browser Data: 'The browser extension you are using is missing the ‘cookies’ permission Do you have any idea what is causing this issue ? i tried disabling the cookies in my machine to replicate the issue but not getting this error in local machine.

Hi @aunekhan ! Glad to know the solution helped you. Unfortunately I’m not familiar with this error, but maybe it’s the difference in version between your machine and production server? Or some specific policy/rule that’s only applied to the prod server?

I’m using UiPath Extension on Chrome version 23.4.2 and Chrome version 117.0.5938.62. My Studio is on 2023.4.4.

I’ve also found this topic with other guidelines on this error: https://forum.uipath.com/t/get-browser-data-the-browser-extension-you-are-using-is-missing-the-cookies-permision/588005/6

Hope it helps

Hi @gowtham.jayavel i have found a way to implement this using only UiPath.

  1. Use Inject JS activity under attach browser.
  2. Write JS code to send API request.
  3. On successful response just redirect it to home page
1 Like

this solution still working?

Hi @BryannLuna ! I had to make an update a while ago. This version should work fine

teste-login-walmart.1.0.2.nupkg (64.1 KB)

1 Like

It worked perfectly! How do you manage if the account doesn’t allow you to log in because there is another active session? I am working in incognito mode because I work with more than 5 client accounts. When there is an error in the download, I do a ‘taskkill’ on the process to ensure that I can log in again, but by doing this while in incognito mode, it indicates that I left an active session and I cannot log in unless I use Chrome without incognito mode. However, this slightly disrupts the logic of the workflow.

If I do the process manually without using the headers and cookies, no matter how many times I end the process in incognito mode, I can always log in again. It seems that the issue is that the ‘data’ of the active session remains.

Screen Shot 2024-06-26 at 19.32.30

Regards!

Hmmm, never had to that before. I think the best solution is to click on the resubmit button and do the login process again. Or maybe open a new tab to download the report after the login/before the taskkill to try ‘cleaning up’ the session cookies

resubmit button disapears a few miliseconds after, the solution was create a mini workflow for delete cache and cookies from settings of the browser

thanks for ur help diogo!

1 Like