How to imitate URL typing and ENTER clicking on Chrome with Selenium and NodeJS

Viewed 277

I'm using Selenium & NodeJS to automate download tests on Chrome.

I noticed that Chrome's download protection behaves differently when clicking a link or redirecting to URL automatically vs actually typing the URL in the address bar and clicking ENTER (Chrome protection doesn't mark some files as blocked when actually typing the URL).

What I tried till now and still got blocks for some files:

  1. driver.get(url)
  2. driver.executeScript to redirect to the url
  3. driver.executeScript to create A element and clicking on it.
  4. opening a new tab and then driver.get(url)

Is there a way to imitate the address bar typing and ENTER clicking with Selenium?

1 Answers

Selenium does not support sending keys to the browser address bar, unfortunately.

Someone suggested a solution with win32com.client library for Node.js here

I haven't tried this but found a similar question on this thread.

Related