0

So, I was doing some automation for Google Play Store(website from computer).

This is the element I am looking to click.

This is the menu which opens when we click the 3 dots on side of review. I have to click one of these 3 menu options then. I am not able to use .click() function on any of these 3 items. All of these 3 span elements of menu are contained in a single div parent.

When I use

element = driver.find_element_by_xpath('/html/body/div[1]/div[4]/c-wiz/div/div[2]/div/div/main/div/div[1]/div[3]/div/div[2]/div[1]/div[2]/div/div[2]/div[2]/div/div/div/span[2]/div[2]')
element.click()

It gives:

ElementNotInteractableException: Message: Element <div class="uyYuVb oJeWuf"> could not be scrolled into view

I tried to click the span, and also its child elements like div which has display:flex also the last div child. But all of them gave the same exception. I know Play Store is mainly for mobile and therefore it is showing the properties of a mobile element. What is the appropriate way to click any of these 3 options then?

here is the link:

Grayrigel
  • 3,474
  • 5
  • 14
  • 32
Steve
  • 13
  • 1

1 Answers1

0

I don't think it is possible to click on a span like this one using selenium. However I think you should try getting the position of this span on the screen so you can click on it using a module like pyautogui :

import pyautogui
pyautogui.click(x=positionx, y=positiony)

This is the only solution I found and I hope you will not have to do it a lot of time in your program since it's repetitive and annoying (to find the x and y positions)

Dyxios
  • 1
  • 1
  • the position of this span might change with Window size and even by a slightest change might break the code this way, U mean we would have to hardcode the values of positions right? isn't there any other way to simulate the behaviour of clicking that menu items? – Steve Oct 23 '20 at 18:52
  • If the position of the span changes with the window size you should try maximizing the size of the window (fullscreen) so it's always at the same point. https://stackoverflow.com/questions/12211781/how-to-maximize-window-in-chrome-using-webdriver-python – Dyxios Oct 24 '20 at 10:07