I’m using an UiPath automation to connect to a platform that launches a website with an unique cookie.
And I want to get this exact cookie to call a new Chrome process later with the same info in the automation. Without this cookie, it’s impossible to reconnect to the page opened by the platform in the first place.
So I went and used : “Use Application/Browser” to get the opened Chrome window, then I added a “Get Browser Data” activity in this process to fetch the cookies.
The issue I have is that it gets me many generic cookies that I don’t need (chrome, microsoft, etc…). What’s bothering me is that these aren’t even in the “Application” tab when Inspecting Chrome. I manually only find the cookie I need and nothing else.
The big issue is that, the String that “Get Browser Data” gave me, isn’t enough. I mean, at some point in the data, I just get “…” in the middle of a cookie, showing me that I don’t see every cookie. So I’m unable to get the one I need.
Any solutions/ideas ? Thanks
Welcome to the community
I believe you are checking the string data by logging in Log message or from the locals panel…And generally in both the places then string would be truncated and shown…
To see the whole string we would recommend to write the string variable to a text file using write text activity which would give you the whole string that is retrieved and from there you can identify the required name of the cookie
Hope this helps
Did you deserialize the data output? If yes, you could just loop through the cookies array, compare the name and url and get the value .
If (item("name").ToString = "SSID" AndAlso item("url").ToString = "https://example.com")
cookie = item("value").ToString
Thanks for the tip, I’m going with this. As I work with Python scripts, it’s easy for me to fetch the right value from an external file. Also, it allows me to slowly check the file to see all the data manually.
It happens that the cookie I was looking for is the last element written there ! So if anyone needs to efficiently use “Get Browser Data”, think of iterating in reverse, should give the best results quickly !
Thanks for this method, I keep it aside as it’s really good and it taught me new mechanics. Though I went with @Anil_G solution as it was easier to implement.
That said, if I wasn’t going to work with Python scripts, I would’ve used your method because it provides a filtering way more easily
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.