K
K
ks_ks2013-05-28 21:01:38
Python
ks_ks, 2013-05-28 21:01:38

Is it possible in Selenium WebDriver to intercept events that happen from outside?

Example - I can click on a button through webdriver, having previously created a Firefox () instance.

from selenium import webdriver as ww

w = ww.Firefox() # вызываем подключенное, для наших целей и задач, окно веб-браузера.
elem = w.find_element_by_id('id')
elem.click() # вот мы по нему кликнули и, предположим, открылась новая страница


Is it possible to somehow programmatically track similar events
that occur not through the webdriver, but manually?
And if so, how?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
B
bayandin, 2013-05-29
@ks_ks

You can use the webdriver to inject javascript that will catch clicks or add such a script to the application code.
You can inject something like this:

$(document).click(function(e) {    
    alert('clicked');
});

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question