Wednesday, 20 February 2019

element not visible despite availability in document in python selenium

Page Link : https://contacts.google.com/u/1/?pageId=none

Desired: I want to select all contacts by clicking the highlighted SVG caret icon in attached image.

Problem facing : Getting error element not visible on svgicon.click(). Though element is clearly available in visible DOM as per image attached.

Observation : I have noticed that if we manually click on caret icon then DropDown html code is being inserted via JavaScript & on any other body click it is removing the DropDown html code.

I know following code statement used to achieve the desired is correct & working but not populating DropDown . Any help is much appreciated.

//find & click on SVG icon

svgicon = driver.find_element_by_css_selector('div.PFdmz .uzHa0d .RANAid[role="button"]')
svgicon.click()

//click on all link post dropdown appears
wait5.until(EC.presence_of_element_located((By.XPATH, '//div[@class = "jO7h3c" and text() = "All"]'))).click()

DOM Image

DOM Image



from element not visible despite availability in document in python selenium

No comments:

Post a Comment