Issue
I am trying to write e2e tests for a Slack bot and while logging in via browser it always asks whether I'd like to use the Slack desktop app instead of continuing with the browser (its Chrome by the way). Steps the Selenium webdriver is performing:
- Visit
https://company-name.slack.com
- Fill in the
email
andpassword
- Click
Sign In
button - Then this shows up:
This is not a normal browser alert but I'd like to get rid of it. I have tried the following:
webdriver.switch_to.alert.dismiss()
Does not dismiss this pop-up- Adding the
chrome_options.add_argument('--disable-default-apps')
switch also doesn't prevent the pop-up from showing - Have tried the headless version as well, test failure suggests that the pop-up interrupted the flow.
This also has to work on CI servers so please if the solution didn't involve modifying developer machine then that would be wonderful.
Solution
Well, this is not an answer but a workaround. I managed to get around the default-app
pop-up by continuing my operations in a new tab (But not before checking whether there is a pop-up in the first place). Psuedo code:
try
find_element_by_whatever(element_you_expect_after_login)
catch TimeoutException
webdriver.execute_script('window.open()')
webdriver.switch_to.window(webdriver.window_handles[1])
webdriver.get(url_which_required_login_in_the_first_place)
Answered By - amith.gotamey
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.