Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Double clicking in python selenium

I am using selenium with python. Im able to get the code below to click where I want but I want it to dbl click. Im not very good with the action chains and I know I need that for dbl click. Can anyone help with what I need to change around?

user = self.find_element_by_id("selUsers")
for option in user.find_elements_by_tag_name("option"):
    if option.text == "Admin, Ascender":
         option.click()
like image 608
user2620763 Avatar asked Jul 25 '13 23:07

user2620763


1 Answers

Action chains is the only best option as far i know

from selenium.webdriver.common.action_chains import ActionChains

driver=self.webdriver
user = self.find_element_by_id("selUsers")
for option in user.find_elements_by_tag_name("option"):
   if option.text == "Admin, Ascender":
      actionChains = ActionChains(driver)
      actionChains.double_click(option).perform()
like image 58
Mahesh Reddy Atla Avatar answered Oct 01 '22 09:10

Mahesh Reddy Atla