cancel
Showing results for 
Search instead for 
Did you mean: 

Testcomplete: How to set a cookie value in smartbear browser for an android app.

SOLVED
New Contributor

Testcomplete: How to set a cookie value in smartbear browser for an android app.

I am testing a android mobile app using Test complete. I am using the smartbear browser on the app for testing the website. 

 

I am looking for a way to set a particular cookie value before i  proceed with my test. Is there a way to set a particular cookie value? Please help.

 

Thanks,

Sridhar.

1 ACCEPTED SOLUTION

Accepted Solutions
Community Hero

Re: How to set a cookie value in Testcomplete for an android app.

Hi Sridhar,

 

Answering your exact question: Cookies are internal functionality of web browsers that is not accessible to regular end-users.

As you said, even in full-fledged Chrome some third-party proxy/extension/application is required to get access to cookies content during runtime. Obviously, I would not expect that something similar exists for the simplified basic SmartBear browser.

 

As a side note: Your scenario more looks like unit/integration/API test rather than functional one. I.e. it looks like to me that you are sending web request with the cookie set to some value and expect to receive certain data in response depending on the cookie's value. This is fine for the API test (and can be easily implemented using, say SoapUI tool). But this is not how real human end-user works. (And primary area of TestComplete is to emulate human end-user actions.) In real world, real user, most probably, will have some login procedure that will set his/her role/permissions and set cookie value based on that. This cookie value will be used than by browser for the data requests.

 

Anyway, if you really need to access/modify cookie values, Fiddler may be an option for you: https://www.telerik.com/blogs/how-to-capture-android-traffic-with-fiddler

 

Regards,
Alex
[Community Expert Group]
____
[Community Expert Group] members are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Postings made by [Community Expert Group] members
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
[Community Expert Group] signature is used with permission by SmartBear Software.
http://smartbear.com/forums/f83/t86934/community-experts/
================================
4 REPLIES 4
Community Hero

Re: How to set a cookie value in Testcomplete for an android app.

Hi Sridhar,

 

I seem do not remember the case when some cookie had to be set during test of web application. Also I am not sure this is possible for the browser. I think this can be done with the help of some proxy (e.g. Fiddler) that will analyse the traffic through it and modify/set required cookie.

Can you provide us with the use case when this is required?

 

Regards,
Alex
[Community Expert Group]
____
[Community Expert Group] members are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Postings made by [Community Expert Group] members
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
[Community Expert Group] signature is used with permission by SmartBear Software.
http://smartbear.com/forums/f83/t86934/community-experts/
================================
New Contributor

Re: How to set a cookie value in Testcomplete for an android app.

Hi Alex,

 

While testing the desktop version of our app, we still need to set a particular cookie value so as to see the expected prices on the webpage. We do this by installing EditThisCookie chrome app and we set the given cookie to the value we want and then start the Testcomplete Testcase on chrome browser. This works very well for us.

 

Now, we are looking to test the same thing on android using smartbear browser and looking for a way to set the cookie.

 

Thanks,

Sridhar.

Community Hero

Re: How to set a cookie value in Testcomplete for an android app.

Hi Sridhar,

 

Answering your exact question: Cookies are internal functionality of web browsers that is not accessible to regular end-users.

As you said, even in full-fledged Chrome some third-party proxy/extension/application is required to get access to cookies content during runtime. Obviously, I would not expect that something similar exists for the simplified basic SmartBear browser.

 

As a side note: Your scenario more looks like unit/integration/API test rather than functional one. I.e. it looks like to me that you are sending web request with the cookie set to some value and expect to receive certain data in response depending on the cookie's value. This is fine for the API test (and can be easily implemented using, say SoapUI tool). But this is not how real human end-user works. (And primary area of TestComplete is to emulate human end-user actions.) In real world, real user, most probably, will have some login procedure that will set his/her role/permissions and set cookie value based on that. This cookie value will be used than by browser for the data requests.

 

Anyway, if you really need to access/modify cookie values, Fiddler may be an option for you: https://www.telerik.com/blogs/how-to-capture-android-traffic-with-fiddler

 

Regards,
Alex
[Community Expert Group]
____
[Community Expert Group] members are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Postings made by [Community Expert Group] members
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
[Community Expert Group] signature is used with permission by SmartBear Software.
http://smartbear.com/forums/f83/t86934/community-experts/
================================
Highlighted
New Contributor

Re: How to set a cookie value in Testcomplete for an android app.

Hi Alex, What ever you said makes sense to me. I am now exploring the option of using Fiddler as proxy and modify the cookie before it is sent to the server. Thanks.

New Here?
Join us and watch the welcome video:
6 / 7 API Testing Mistakes Video