D
D
doublench212017-11-05 15:47:20
JavaScript
doublench21, 2017-11-05 15:47:20

Does XHR make Selenium requests?

Let's say on some page, by means of it setIntervalperforms some xhr request with some periodicity. Will Selenium execute these same requests while the page code is loaded into it?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry Eremin, 2017-12-21
@doublench21

well, actually, it should. JS, whether it will work or not work at all.
Just in case, if it still doesn't work, you can always force the driver to execute your script.

WebDriver driver = new ChromeDriver();

if (driver instanceof JavascriptExecutor) {
  ((JavascriptExecutor) driver).executeScript("alert('hello world');");
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question