Selenium click Salesforce lightning dropdown

212 views
Skip to first unread message

Alex

unread,
Jun 23, 2021, 11:28:04 PM6/23/21
to Selenium Users
Hi Selenium Gurus,
I was trying to use Selenium to click the dropdown menu that is highlighted in the snapshot. I was able to locate the triangle dropdown button in my script, and my xpath for locating the "Deep Clone" option inside the dropdown menu worked as well, however, it returned "selenium.common.exceptions.ElementNotInteractableException: Message: element not interactable: element has zero size" when reaching to the step of clicking "Deep Clone".. Anyone could guide me why by any chance?? Thanks!!

Below is my script:
browser.get(baseUrl)
browser.find_element_by_id("username").send_keys(username)
browser.find_element_by_id("password").send_keys(password)
browser.find_element_by_id("Login").click()
browser.implicitly_wait(5)
browser.find_element_by_xpath('//div[@class="uiInput uiAutocomplete uiInput--default"]//input[@role="combobox"]').send_keys("Test Plan Benchmark")
browser.implicitly_wait(5)
browser.find_element_by_xpath('//ul[@role="presentation"]//span[@title="Test Plan Benchmark"]').click()
browser.implicitly_wait(5)
browser.find_element_by_xpath('//li[@class="slds-dropdown-trigger slds-dropdown-trigger_click slds-button_last overflow"]//lightning-button-menu[@class="menu-button-item slds-dropdown-trigger slds-dropdown-trigger_click"]').click()
browser.find_element_by_xpath('//lightning-button-menu[contains(@class,"menu-button-item slds-dropdown-trigger slds-dropdown-trigger_click")]//runtime_platform_actions-action-renderer[@title="Deep Clone"]').click()
browser.quit()


Screen Shot 2021-06-21 at 5.16.04 PM.png
Reply all
Reply to author
Forward
0 new messages