Testing_Framework_2022_1_0601_1_Free set cookie fine for edge, but not work for chrome.
Testing_Framework_2021_1_0309_1_Free set cookie fine for chome.
I am not sure if Testing_Framework_2022_1_0601_1_Free got any update on set cookie funciton.
1 Answer, 1 is accepted
0
Plamen Mitrev
Telerik team
answered on 20 Jul 2022, 07:58 AM
Hello Jun,
I tested the code to set and get a cookie in Chrome and Edge with the latest official version 2022.1.601 on my end. The sample code in our documentation and what looks to be your code, should work without issues, unless there is a problem with the cookie or browser.
I tested against Edge Chromium 103.0.1264.62 and Chrome 103.0.5060.134 and it worked as expected. You can find the code snippet from two different approaches below and compare that to your code and behavior.
Manager.LaunchNewBrowser();
const string url = "http://www.google.com";
{
var cookie = new System.Net.Cookie("foo", "bar", "/", url);
//var cookie = new System.Net.Cookie();
cookie.Expires = DateTime.MaxValue;
var ok = ActiveBrowser.Cookies.SetCookie(cookie);
}
var c = ActiveBrowser.Cookies.GetCookies("http://www.google.com");
var count = c.Count;
Log.WriteLine(count.ToString());
foreach (System.Net.Cookie cookie in ActiveBrowser.Cookies.GetCookies("http://www.google.com"))
{
Log.WriteLine(cookie.Name);
Log.WriteLine(cookie.Value);
}
I hope the information and code samples will be helpful to you. Otherwise, let me know what is the state of thee issue and we can continue our discussion.
Regards,
Plamen Mitrev
Progress Telerik
The Premier Dev Conference is back!
Coming to you live from Progress360 in-person or on your own time, DevReach for all. Register Today.
Testing_Framework_2022_1_0601_1_Free set cookie fine for edge, but not work for chrome.
Testing_Framework_2021_1_0309_1_Free set cookie fine for chome.
I am not sure if Testing_Framework_2022_1_0601_1_Free got any update on set cookie funciton.