Questions tagged [headless-browser]

A headless browser is a web browser without a graphical user interface. They are used to provide content of web pages to other programs.

A headless browser is a browser without a GUI. In most cases, it can be accessed from a command line.

They are typically used for automated testing of websites.

Examples include:

748 questions
3
votes
1 answer

PhantomJS to capture next page content after button click event

I am trying to capture second page content after click method. But it is returning front page content. const status = await page.open('https://www.dubailand.gov.ae/English/services/Eservices/Pages/Brokers.aspx'); console.log(status); await…
Adeel Tahir
  • 187
  • 2
  • 10
3
votes
1 answer

Use python selenium on headless linux server

I have a Linux server which can only be controlled via CLI. It doesn't have any browser installed, mainly because it is not needed and because unless it's lynx or a derivative, it is going to install x-server, which I don't want. I know I can run…
Hamperfait
  • 465
  • 1
  • 6
  • 18
3
votes
1 answer

UnhandledPromiseRejectionWarning when running Puppeteer?

Why do I get the following warnings, and how can I get rid of them? Warnings: (node:26771) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: Protocol error (Runtime.callFunctionOn): Target closed. (node:26771)…
3
votes
0 answers

How to test UI of HTML file in headless browser using Mocha.js

I have a bunch of unit tests: /tests/modules/unit-test-1.js /tests/modules/unit-test-2.js /tests/modules/unit-test-3.js ... .. that I run by doing: mocha ./tests/modules/*.js I also have a my-ui.html file and I want to run a UI test on that…
Kawd
  • 4,122
  • 10
  • 37
  • 68
3
votes
2 answers

How to serve up HTML snapshots of an AJAX app with a headless browser, from PHP?

Having real trouble working out how to fire up a headless browser to serve up static HTML snapshots of a site that uses javascript (sammy.js, to be specific) to deliver the AJAX content. I'm working off Google's specification for making AJAX apps…
3
votes
1 answer

Headless Chrome script to use the same session and skip two-factor authentication

There is a website that uses two-factor authentication. On the login form there is a checkbox that, when checked, allows me to bypass the two-factor authentication step (for the current device) in the future after successfully logging in the first…
3
votes
2 answers

How to run chrome headless browser

I have been trying to set up chromes headless browser on my mac but I am getting errors. I tried following these tutorials for…
3
votes
1 answer

Headless Edge driven through Selenium by C#

Given that Selenium can drive the Edge browser for programming automated testing in C#, as noted in this article: https://blogs.windows.com/msedgedev/2015/07/23/bringing-automated-testing-to-microsoft-edge-through-webdriver/ Is it possible to run it…
Matt W
  • 11,753
  • 25
  • 118
  • 215
3
votes
2 answers

how do I set a proxy server in my headless chrome request using Node JS Puppeteer

/I am running a headless search request on chrome and i need to access a proxy server/ const puppeteer = require('puppeteer'); var url="https://www.google.com/search?q="; var keyword="hotels"; var urls; var desktopUserAgent="Mozilla/5.0…
Ashwin Nair
  • 35
  • 2
  • 6
3
votes
1 answer

Running karma tests in headless Firefox browser not working on Jenkins

First time asking a question on SO. Please be kind. I will graciously accept question feedback. I have a Jenkins instance running on an openSUSE Linux machine that I do not have root access to. I have configured Jenkins with a custom tool…
binskits
  • 248
  • 1
  • 3
  • 10
3
votes
1 answer

Print image with Chrome using command line switches / startup arguments

Is there a way to open an image url with Chrome and print that image on start up using command line switches (start up arguments). It can be headless or non headless. Printing to the default printer is fine as well. This appears to be a complete…
3
votes
1 answer

Selenium Chrome Headless download file

I use headless chrome and selenium but i have problem in downloading file. Using options: prefs = {"download.default_directory": dr, "download.prompt_for_download": False, "download.directory_upgrade": True, …
3
votes
1 answer

Network.emulateNetworkConditions doesn't work in chrome 59 --headless

I'm trying to simulate regular 3G connection in chrome --headless (chrome version 59) by using chrome-remote-interface with this example as starting point const CDP = require('chrome-remote-interface'); const fs = require('fs'); CDP(async (client)…
3
votes
0 answers

Headless browser on android supporting websockets?

Well I'm working on a project which requires me to do a couple of automated things on a website. Its all working good. I've setup WebView and binded JS interface with Java on android to communicate with it. It works great. But it is really ugly and…
mehulmpt
  • 15,861
  • 12
  • 48
  • 88
3
votes
1 answer

Selenium best way to chrome headless parallel instances python

I'm getting really confused with python and selenium. I've set up both chrome and Phantomjs with selenium on mac and it's working ok. However, I can only run phantomjs as headless, and it's getting really frustrating having to code things twice (for…
Ke.
  • 2,484
  • 8
  • 40
  • 78