Update BrowserAppHelper with button id

The text on negative button was updated "No thanks" -> "No, thanks". Replaced matching by text to matching by button id

Bug: 430191139
Flag: EXEMPT not needed for the funcitonal test
Test: atest TabTearingTest

Change-Id: Ib8eae3d686a82c017258ec4bfaabd8e2c1c9b30a
diff --git a/libraries/flicker/appHelpers/src/android/tools/device/apphelpers/BrowserAppHelper.kt b/libraries/flicker/appHelpers/src/android/tools/device/apphelpers/BrowserAppHelper.kt
index 8d88bd5..c8c5e31 100644
--- a/libraries/flicker/appHelpers/src/android/tools/device/apphelpers/BrowserAppHelper.kt
+++ b/libraries/flicker/appHelpers/src/android/tools/device/apphelpers/BrowserAppHelper.kt
@@ -163,14 +163,14 @@
      */
     fun closePopupsIfNeeded(device: UiDevice): Boolean {
         if (device.hasObject(By.text(NOTIFICATION_PERMISSION_TEXT))) {
-            val negativeButton = device.findObject(By.text(NEGATIVE_BUTTON_TEXT))
+            val negativeButton = device.findObject(By.res(packageName, NEGATIVE_BUTTON_ID))
             negativeButton.click()
             Log.d(TAG, "Dismiss grant notification pop-up")
             return true
         }
 
         if (device.hasObject(By.text(AD_PRIVACY_TITLE_TEXT))) {
-            val negativeButton = device.findObject(By.text(NEGATIVE_BUTTON_TEXT))
+            val negativeButton = device.findObject(By.res(packageName, NEGATIVE_BUTTON_ID))
             negativeButton.click()
             Log.d(TAG, "Dismiss ad privacy pop-up")
 
@@ -210,7 +210,7 @@
         private const val NOTIFICATION_PERMISSION_TEXT = "Chrome notifications make things easier"
         private const val AD_PRIVACY_TITLE_TEXT = "Turn on an ad privacy feature"
         private const val OTHER_AD_PRIVACY_TITLE_TEXT = "Other ad privacy features now available"
-        private const val NEGATIVE_BUTTON_TEXT = "No thanks"
+        private const val NEGATIVE_BUTTON_ID = "negative_button"
         private const val MORE_BUTTON_ID = "more_button"
         private const val ACKNOWLEDGED_BUTTON_TEXT = "Got it"