Questions tagged [htmlunit-driver]

Selenium HtmlUnit Driver is a WebDriver implementation using HtmlUnit as browser.

Selenium HtmlUnit Driver is a WebDriver implementation which allows to control the headless browser HtmlUnit via the WebDriver API.

215 questions
2
votes
1 answer

HtmlUnitDriver Error: java.lang.NoClassDefFoundError: com/gargoylesoftware/htmlunit/WebWindowListener

I created a java class called htmlUnitTest to do a test with Selenium Headless Testing. The class basically goes to the google site and writes a text in the search box of the site, does the search and takes the page title and displays the title in…
Kakashi - Sensei
  • 371
  • 1
  • 6
  • 22
2
votes
1 answer

How to set up HTMLUnit Driver with selenium in python?

Reading the answers on here has led me to understand that I need to connect to the Selenium Java server because HTMLUnit is implemented in java. I don't really understand what this means and would appreciate if someone would point me in the right…
2
votes
1 answer

Htmlunit driver has trouble with Javascript

I wrote a Selenium test with java that I launched with the FirefoxDriver and it is executing fine in Firefox browser. Then I am replacing FirefoxDriver with HtmlunitDriver like this: driver = new FirefoxDriver(); with driver = new…
2
votes
2 answers

Selenium remote driver issue with HtmlUnit driver

[i'm seeing the issue with Selenium remote driver when I'm executing the script with Htmlunit driver. Note 1:- Same script works without any issue when I'm running with Firefox driver.] Note 2: My browser had security authentication process for…
Rajesh Varma
  • 151
  • 2
  • 10
2
votes
0 answers

Reason behind adding HTML Unit Driver in Selenium 3.0.1

As suggested in the below link, selenium has removed HTMLUnitDriver from selenium distribution as per its evolution strategy. https://github.com/SeleniumHQ/selenium/issues/2381 While working on Selenium 3.0.1, i have found that HTMLUnitDriver is…
2
votes
0 answers

Why Selenium HtmlUnit or PhamtonJs have some trouble to execute Js code

I'm trying to run my selenium test in a headless browser (htmlUnit Webdriver, and phamtomJs). But whatever i use, some exception is thrown by the execution of javascript code, or error when i try to use an event which will use javascript in the html…
Omegaspard
  • 1,828
  • 2
  • 24
  • 52
2
votes
0 answers

How can I avoid JavaScript Errors in Selenium's HtmlUnitDriver?

I'm new to Selenium and I'm trying to connect to a site. String url = [url][1] WebDriver driver = new HtmlUnitDriver(true); driver.get(url); I'm facing JavaScript errors while executing this line. I searched few questions and also tried…
2
votes
1 answer

How can I wait a page to load with selenium htmlunitDriver?

I am working on a bot for a page similar to Ad.fly. After opening the link, I want to wait five seconds for the page to load before the button to click appears. I want to execute this with HtmlunitDriver. I tried with implicit wait and explicit…
Leo Galindo
  • 186
  • 5
  • 15
2
votes
1 answer

com.gargoylesoftware.htmlunit.ScriptException: Exception invoking open

I'm working with an intranet site. When I login to the "https://itam.flextron.com.au/arsys/shared/login.jsp" website via chrome or IE browser it's work fine. However while I login to the website via browser a window pop up and closes automatically…
user2782522
  • 191
  • 1
  • 3
  • 13
2
votes
0 answers

Recognize Alert with Selenium and HtmlUnitDriver or PhantomJsDriver

I use Selenium 2.42.0 with Java (in Eclipse) and I need to use as WebDriver a headless browser like HtmlUnit-driver (2.42.2) or PhantomJS (Ghostdriver). It`s important that I can handle alerts in Java (Eclipse), which i trigger on purpose for…
juzwani
  • 53
  • 2
  • 7
2
votes
2 answers

Selenium. HtmlUnitDriver. How to enable JavaScript and Cookies?

This is an error I get when I try to navigate to page, using HtmlUnitDriver: JavaScript and Cookies need to be supported in order to use the site. To be able to use all of the site's functions, download and install one of the following…
mrk2
  • 797
  • 3
  • 9
  • 20
1
vote
2 answers

How to prevent HtmlUnit from throwing an error that is in the javascript?

I'm trying to login to one website, and after entering successfully username and password, and after clicking on submit button, I'm getting the following: 2023-05-27 16:46:41.864 ERROR 296 --- [nio-8080-exec-2] c.g.h.j.DefaultJavaScriptErrorListener…
1
vote
2 answers

HtmlUnitDriver no need to load page

I am writing a test that should get only the URL from the redirect, there is no need to load the non-existing page. Every time I get this exception: java.lang.RuntimeException: java.net.UnknownHostException: No such host is known…
Sanady_
  • 68
  • 10
1
vote
1 answer

Unable to click buttons with HtmlUnitDriver but able to click buttons with FirefoxDriver

I have a code using Selinium HtmlUnitDrive. I'm able to access the website and click the except cookies but I can't seem to click the play demo button. I don't what is a problem because I can click all buttons using FirefoxDriver. Before I could not…
1
vote
1 answer

Selenium unable to locate element by id/name

This question has been asked many times, but none of the answers seem to work. I am trying to simply locate the search bar on the google front page (https://google.com). If looking at the inspector, you can clearly see, that the name of the search…
1 2
3
14 15