klept0/MS-Rewards-Farmer

Bug: Close Streak popup

Opened this issue · 5 comments

Before submitting a bug report...

  • #190
    (I have checked every bug report on GitHub)

  • I've cleared the sessions folder.

Branch

master

Commit

0a94091

Describe the bug

Upon logging in, a popup alerting user to enable streaks blocks all clicks.

Propose immediately after logging in, check to see if element is visible and clicking the "Maybe Later" button if so. HTML Element included with screenshot below

Copy and paste your error

2024-08-26 09:58:41 [INFO] [root] [browser.py:142] Screen size: 2552x922
2024-08-26 09:58:41 [INFO] [root] [browser.py:143] Device size: 2497x771
2024-08-26 09:58:58 [INFO] [root] [login.py:29] [LOGIN] Logging-in...
2024-08-26 09:58:58 [INFO] [root] [login.py:38] [LOGIN] Entering email...
2024-08-26 09:59:08 [INFO] [root] [login.py:65] [LOGIN] Entering password...
2024-08-26 09:59:27 [INFO] [root] [login.py:31] [LOGIN] Logged-in successfully !
2024-08-26 09:59:30 [INFO] [root] [main.py:239] [POINTS] You have 0.00 points on your account
2024-08-26 09:59:30 [INFO] [root] [dailySet.py:17] [DAILY SET] Trying to complete the Daily Set...
2024-08-26 09:59:44 [ERROR] [root] [dailySet.py:83] [DAILY SET] Error Daily Set of card 1
Traceback (most recent call last):
  File "/msrewards/src/utils.py", line 250, in click
    element.click()
  File "/usr/local/lib/python3.10/dist-packages/selenium/webdriver/remote/webelement.py", line 94, in click
    self._execute(Command.CLICK_ELEMENT)
  File "/usr/local/lib/python3.10/dist-packages/selenium/webdriver/remote/webelement.py", line 395, in _execute
    return self._parent.execute(command, params)
  File "/usr/local/lib/python3.10/dist-packages/selenium/webdriver/remote/webdriver.py", line 354, in execute
    self.error_handler.check_response(response)
  File "/usr/local/lib/python3.10/dist-packages/selenium/webdriver/remote/errorhandler.py", line 229, in check_response
    raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.ElementClickInterceptedException: Message: element click intercepted: Element <a class="ds-card-sec ng-scope" ng-if="$ctrl.item.callToAction.text" aria-disabled="false" aria-label="Galactic views   Explore how a telescope provides a view of outer space   10 points" target="true" role="link">...</a> is not clickable at point (832, 571). Other element would receive the click: <div class="dashboardPopUpModal" ng-show="$ctrl.isModalVisible">...</div>
  (Session info: chrome=128.0.6613.84)
Stacktrace:
#0 0x556915aaf81a <unknown>
#1 0x55691577de50 <unknown>
#2 0x5569157d4346 <unknown>
#3 0x5569157d225d <unknown>
#4 0x5569157cfcf7 <unknown>
#5 0x5569157ceb9c <unknown>
#6 0x5569157c24d6 <unknown>
#7 0x5569157f2492 <unknown>
#8 0x5569157c1e89 <unknown>
#9 0x5569157f265e <unknown>
#10 0x5569158109c6 <unknown>
#11 0x5569157f2233 <unknown>
#12 0x5569157c0093 <unknown>
#13 0x5569157c109e <unknown>
#14 0x556915a76a7b <unknown>
#15 0x556915a7aa31 <unknown>
#16 0x556915a62645 <unknown>
#17 0x556915a7b5a2 <unknown>
#18 0x556915a4781f <unknown>
#19 0x556915a9e618 <unknown>
#20 0x556915a9e7e2 <unknown>
#21 0x556915aae60c <unknown>
#22 0x7f51e47e8ac3 <unknown>
all values are hidden
all values are hidden
During handling of the above exception, another exception occurred:
all values are hidden
Traceback (most recent call last):
  File "/msrewards/src/dailySet.py", line 27, in completeDailySet
    self.activities.openDailySetActivity(cardId)
  File "/msrewards/src/activities.py", line 21, in openDailySetActivity
    self.browser.utils.click(element)
  File "/msrewards/src/utils.py", line 253, in click
    element.click()
  File "/usr/local/lib/python3.10/dist-packages/selenium/webdriver/remote/webelement.py", line 94, in click
    self._execute(Command.CLICK_ELEMENT)
  File "/usr/local/lib/python3.10/dist-packages/selenium/webdriver/remote/webelement.py", line 395, in _execute
    return self._parent.execute(command, params)
  File "/usr/local/lib/python3.10/dist-packages/selenium/webdriver/remote/webdriver.py", line 354, in execute
    self.error_handler.check_response(response)
  File "/usr/local/lib/python3.10/dist-packages/selenium/webdriver/remote/errorhandler.py", line 229, in check_response
    raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.ElementClickInterceptedException: Message: element click intercepted: Element <a class="ds-card-sec ng-scope" ng-if="$ctrl.item.callToAction.text" aria-disabled="false" aria-label="Galactic views   Explore how a telescope provides a view of outer space   10 points" target="true" role="link">...</a> is not clickable at point (832, 571). Other element would receive the click: <div class="dashboardPopUpModal" ng-show="$ctrl.isModalVisible">...</div>
  (Session info: chrome=128.0.6613.84)
Stacktrace:
#0 0x556915aaf81a <unknown>
#1 0x55691577de50 <unknown>
#2 0x5569157d4346 <unknown>
#3 0x5569157d225d <unknown>
#4 0x5569157cfcf7 <unknown>
#5 0x5569157ceb9c <unknown>
#6 0x5569157c24d6 <unknown>
#7 0x5569157f2492 <unknown>
#8 0x5569157c1e89 <unknown>
#9 0x5569157f265e <unknown>
#10 0x5569158109c6 <unknown>
#11 0x5569157f2233 <unknown>
#12 0x5569157c0093 <unknown>
#13 0x5569157c109e <unknown>
#14 0x556915a76a7b <unknown>
#15 0x556915a7aa31 <unknown>
#16 0x556915a62645 <unknown>
#17 0x556915a7b5a2 <unknown>
#18 0x556915a4781f <unknown>
#19 0x556915a9e618 <unknown>
#20 0x556915a9e7e2 <unknown>
#21 0x556915aae60c <unknown>
#22 0x7f51e47e8ac3 <unknown>

Screenshots

Screenshot 2024-08-26 at 10 00 51 AM

HTML element for this modal that should be clicked after logging in

<a ng-if="$ctrl.popUpHasTwoBtn()" class="dashboardPopUpPopUpCloseButton ng-binding ng-scope" data-bi-id="rx-nav-popup-close" ng-click="$ctrl.hidePopUp($event)">
                Maybe Later
            </a>

Value of dashboard variable

N/A

oh we do love malware

cal4 commented

@ttraxxrepo, to me this is a bug rather than an enhancement. Can you update the title as such?

I get a similar error as well, but only on the 2nd card. Happened the past couple days. I have streak protection on. btw: The new # of searches code is working great! Also, release version 1.0.0 is marked the latest, when 1.0.1 exists

2024-08-27 04:43:41,409 [ERROR] [DAILY SET] Error Daily Set of card 2
Traceback (most recent call last):
  File "/app/src/utils.py", line 250, in click
    element.click()
  File "/usr/local/lib/python3.12/site-packages/selenium/webdriver/remote/webelement.py", line 94, in click
    self._execute(Command.CLICK_ELEMENT)
  File "/usr/local/lib/python3.12/site-packages/selenium/webdriver/remote/webelement.py", line 395, in _execute
    return self._parent.execute(command, params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/selenium/webdriver/remote/webdriver.py", line 354, in execute
    self.error_handler.check_response(response)
  File "/usr/local/lib/python3.12/site-packages/selenium/webdriver/remote/errorhandler.py", line 229, in check_response
    raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.ElementNotInteractableException: Message: element not interactable
  (Session info: chrome=127.0.6533.119)
Stacktrace:
#0 0x5583242a86ca <unknown>
....
During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/app/src/dailySet.py", line 47, in completeDailySet
    self.activities.completeQuiz()
  File "/app/src/activities.py", line 85, in completeQuiz
    self.browser.utils.click(element)
  File "/app/src/utils.py", line 253, in click
    element.click()
  File "/usr/local/lib/python3.12/site-packages/selenium/webdriver/remote/webelement.py", line 94, in click
    self._execute(Command.CLICK_ELEMENT)
  File "/usr/local/lib/python3.12/site-packages/selenium/webdriver/remote/webelement.py", line 395, in _execute
    return self._parent.execute(command, params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/selenium/webdriver/remote/webdriver.py", line 354, in execute
    self.error_handler.check_response(response)
  File "/usr/local/lib/python3.12/site-packages/selenium/webdriver/remote/errorhandler.py", line 229, in check_response
    raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.ElementNotInteractableException: Message: element not interactable
  (Session info: chrome=127.0.6533.119)
Stacktrace:
#0 0x5583242a86ca <unknown>

cal4 commented

Related to #193

cal4 commented

Ideally we can add dismissal to one of these:

def tryDismissAllMessages(self) -> None:
buttons = [
(By.ID, "iLandingViewAction"),
(By.ID, "iShowSkip"),
(By.ID, "iNext"),
(By.ID, "iLooksGood"),
(By.ID, "idSIButton9"),
(By.ID, "bnp_btn_accept"),
(By.ID, "acceptButton"),
]
for button in buttons:
try:
elements = self.webdriver.find_elements(by=button[0], value=button[1])
except (NoSuchElementException, ElementNotInteractableException): # Expected?
logging.debug("", exc_info=True)
continue
for element in elements:
element.click()
self.tryDismissCookieBanner()
self.tryDismissBingCookieBanner()
def tryDismissCookieBanner(self) -> None:
with contextlib.suppress(NoSuchElementException, ElementNotInteractableException): # Expected
self.webdriver.find_element(By.ID, "cookie-banner").find_element(
By.TAG_NAME, "button"
).click()
def tryDismissBingCookieBanner(self) -> None:
with contextlib.suppress(NoSuchElementException, ElementNotInteractableException): # Expected
self.webdriver.find_element(By.ID, "bnp_btn_accept").click()