D
D
Denis99992017-06-23 15:48:59
Python
Denis9999, 2017-06-23 15:48:59

Keystrokes in Selenium Python Webdriver?

To test the correctness, I started pressing the keys after the input was clicked to see if they were being pressed.

elem = driver.find_element_by_id("q")
elem.send_keys('t')
ActionChains(driver).key_down(Keys.LEFT_SHIFT).send_keys('ff').perform()

The code above will enter tFF into the input, that is, the left shift is clamped. But it is worth rewriting it to CTRL + t:
ActionChains(driver).key_down(Keys.LEFT_CONTROL).send_keys('t').perform()

And it does not work, even though logically it should.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Ivan, 2017-06-23
@galbator1x

There may be a problem with the Firefox driver in ActionChains, try without it.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question