Listening to browser events in the transporter

Is there a way to connect event listeners to browser events in the Protractor test?

I know that Protractor works like a Node program, but I'm curious if someone did this with a Node package like browserevent .

Look for any examples if this is the case.

+5
source share
1 answer

In my opinion, in the spirit of a tractor, No, this is not possible. A protractor is a layer above selenium. Webdriver is a kind of JSON protocol that sends a command to communicate with the browser. These commands are stored in the promises queue and then returned by async to Protractor. You can then do an Assertion with the keyword β€œWait” for jasmine to inspect the DOM.

If you still need to find a way, you will try the hacker way:

browser.driver.executeScript ("YOUR JAVASCRIPT CODE HERE;");

Then you exchange this call in the .wait () browser, but I would not recommend this method.

thanks

+1
source

Source: https://habr.com/ru/post/1203316/


All Articles