Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

long press selenium python

#encoding=utf-8
import unittest
import time
from selenium import webdriver
from selenium.webdriver import ActionChains
import win32clipboard as w
import win32con

# Set clipboard content
def setText(aString):
    w.OpenClipboard()
    w.EmptyClipboard()
    w.SetClipboardData(win32con.CF_UNICODETEXT, aString)
    w.CloseClipboard()


class VisitSogouByIE(unittest.TestCase):

    def setUp(self):
        #Start IE browser
        #self.driver = webdriver.Firefox(executable_path = "e:geckodriver")
        self.driver = webdriver.Ie(executable_path = "e:IEDriverServer")
        
    def test_simulationLeftClickMouseOfProcess(self):
        url = "http://127.0.0.1/test_mouse.html"
        #  Visit a custom html page
        self.driver.get(url)
        div = self.driver.find_element_by_id("div1")
        from selenium.webdriver import ActionChains
        import time
        #  Press and hold the left mouse button on the element whose id attribute value is "div1"
        ActionChains(self.driver).click_and_hold(div).perform()
        time.sleep(2)
        #  Release the left mouse button that has been released on the element whose id attribute value is "div1"
        ActionChains(self.driver).release(div).perform()
        time.sleep(2)
        ActionChains(self.driver).click_and_hold(div).perform()
        time.sleep(2)
        ActionChains(self.driver).release(div).perform()

    def tearDown(self):
        #  Exit IE browser
        self.driver.quit()

if __name__ == '__main__':
    unittest.main()
Comment

PREVIOUS NEXT
Code Example
Python :: create schema dynamo revit 
Python :: print dataframe row horizontally 
Python :: how to recover a list from string in python 
Python :: funcion que reciba una cadena en python 
Python :: softmax for nparray 
Python :: sorting-a-python-list-by-two-fields 
Python :: mumtiply to matrices python 
Python :: pep8 E302 
Python :: python length checker/fill 
Python :: odoo - add one2many field programmatically 
Python :: how to use rbind() to combine dataframes 
Python :: convert timestamp datetime to int no astype 
Python :: pandas row printed horizontally 
Python :: histogram plot seaborn 
Python :: anagram game 
Python :: python pycharm 
Python :: django array of dates 
Python :: write to file python 
Python :: grepper how to use fraction 
Python :: how to concatenate all list inside list 
Python :: python range function 
Python :: python classmethod property 
Python :: tkinter mouse loading cursor 
Python :: keep only min entries in dataframe grouped by one column 
Python :: divide all the numbers of a list by one number python 
Python :: how to add sum of range in python 
Python :: python attributes from string 
Python :: how to remove zero after decimal float python 
Python :: nested dict 
Python :: enumerate function in python for loop 
ADD CONTENT
Topic
Content
Source link
Name
6+3 =