App open google browser


#1

Hi
I have an app and i have to sign in buttons:
one for Facebook and another for google.

My problem that i’m working on appium an each scenario start with clear cache correctly.
But for the sign in for Facebook and the google, these two scenarios will fail because the browser keeps my login history.
how can i clear the cache for the browser too while working on appium driver on each scenario not just clearing the app cache?


#2

Seems like the best you can do is to open up a private tab:


#3

Thx wreed
but i can’t control this (open a private tap) because the browser is opens when i click on Facebook icon from my app


#4

@malhaj88 You can clear the chrome app data with

   adb shell pm clear packageName

Appium has the ability to execute adb command, you can run as below as part of the setup or just before you are going to perform the action which leads to the chrome.

   driver.execute_script('mobile: shell', {'command': 'shell pm clear', 'args':'packageName'})

Keep in mind that once you clear the application cache from Chrome you will have to go through the on-boarding flow.


#5

Sounds interesting, nice to know that.
thx a lot @pr4bh4sh, will try this