1

preview

So basically I can't click an element this thing pops up I'm using developer tools for mobile emulation in selenium
script will stop functioning (semi-crash) even though i close this popup manually it wont fix

driver.find_element(By.XPATH, '/html/body/div[1]/section/nav[2]/div/div/div[2]/div/div/div[3]').click()

I've Tried send_keys(Keys.RIGHT) or enter, headless mode and ...

4
  • Can you explain a bit more, so you want to click that black circle button, but that context menu appears? am I correct? Commented Aug 2, 2020 at 10:50
  • @DurgaPrasadBehera yes, the click function wont work at all, I've tried other elements, switching windows, headless option and ... but it just won't work Commented Aug 2, 2020 at 10:56
  • Just try if manually also that pop-up comes, after clicking that button. Or else give it a try with actions double click method. Commented Aug 2, 2020 at 10:58
  • @DurgaPrasadBehera I'm assuming that Devtools or mobile mode is making elements unclickable, the thing is program will stop functioning even though i manually close the pop-up Commented Aug 2, 2020 at 11:11

1 Answer 1

2

So the touch function in Chrome developer tools Device emulator was blocking the selenium clicks by popping an alert up !
Solution: Change your emulated device to no-touch mode
Open developer-tools(F12) and then click on cell Phone icon(CTRL+SHIFT+M), on emulator panel click those 3 dots and enable Device Type now change the it from mobile to mobile(no touch)
Image

Sign up to request clarification or add additional context in comments.

1 Comment

Please answer with more than a link, if it ever dies, this answer becomes useless

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.