Testcomplete: How to set a cookie value in smartbear browser for an android app.
SOLVED- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
Solved! Go to Solution.
- Labels:
-
Android
-
Hybrid Application
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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?
/Alex [Community Champion]
____
[Community Champions] 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. Posts made by [Community Champions]
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.
The [Community Champion] signature is assigned on quarterly basis and is used with permission by SmartBear Software.
https://community.smartbear.com/t5/Community-Champions/About-the-Community-Champions-Program/gpm-p/252662
================================
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
/Alex [Community Champion]
____
[Community Champions] 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. Posts made by [Community Champions]
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.
The [Community Champion] signature is assigned on quarterly basis and is used with permission by SmartBear Software.
https://community.smartbear.com/t5/Community-Champions/About-the-Community-Champions-Program/gpm-p/252662
================================
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
