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
33
votes
3 answers

HtmlUnitDriver (HtmlUnit) vs GhostDriver (PhantomJS)?

We are in the middle of choosing our headless browser driver solution that will be some implementation of Selenium WebDriver. There is the GhostDriver, which leverages the PhantomJS in the backend on the one side and HtmlUnitDriver which based on…
Johnny
  • 14,397
  • 15
  • 77
  • 118
24
votes
3 answers

Is there an HtmlUnitDriver for .NET?

I'm using Selenium's WebDriver to run some SpecFlow tests for an ASP.NET MVC app I'm working on for self-education. Using FirefoxDriver, ChromeDriver, etc. all take so long to run, it's actually pretty frustrating to use them (in my opinion). I have…
Dan Tao
  • 125,917
  • 54
  • 300
  • 447
19
votes
3 answers

HtmlUnit ignore JavaScript errors?

I'm trying to traverse through a website but on one of their pages I get this error: EcmaError: lineNumber=[671] column=[0] lineSource=[null] name=[TypeError] sourceName=[https://reservations.besodelsolresort.com/asp/CalendarPopup.js]…
cantread
  • 405
  • 1
  • 7
  • 14
14
votes
5 answers

Why doesn't HtmlUnitDriver execute JavaScript?

I got the following problem: I am running a JUnit testCase with Selenium 2.9 using HtmlUnitDriver with Browserversion Firefox_3_6. JavaScript is enabled. Now when it should call and execute the following javaScript function it does nothing: function…
Tarken
  • 2,112
  • 2
  • 23
  • 42
7
votes
1 answer

Selenium HtmlUnitDriver Web Scrape Got Captcha Page From EC2 Server

I wrote a simple web scraper to scrape expedia.com. Using Java Selenium HtmlUnitDriver, i was able to successfully scrape data from the site if i run it locally. However, when i deploy this on to an EC2 Server, it always returns me the page where…
7
votes
1 answer

Selenium 3.0.x with HTMLUnitDriver

I have selenium-java 3.0.1 in my Maven project. I have read that this version does not come packaged with HTMLUnitDriver. So, I have separately included selenium-htmlunit-driver 2.52.0 in my pom (the latest version available). However, when I do…
user1825770
  • 359
  • 1
  • 6
  • 17
6
votes
2 answers

Handling alerts using HtmlUnitDriver in Java

I want to handle alerts Using HTMLUnitDriver in java. I am using following code to handle the alerts using firefox driver and it is working fine. Alert alert = driver.switchTo().alert(); alert.accept(); but HTMLUnitDriver is giving error like…
iRunner
  • 1,472
  • 6
  • 25
  • 40
5
votes
1 answer

Why would HtmlUnitDriver not Locate WebElements but FirefoxDriver able to locate the same WebElements

I have a question. What makes FirefoxDriver be able to locate WebElements and click on them in a java code but when running the same code with HtmlUnitDriver the same WebElements are not located. Also when running the same code on HtmlUnit(applying…
5
votes
1 answer

Difference of Headless browsers for automation

The main difference is, execution on GUI bases and non GUI bases(Headless). I am looking for difference between all Headless browsers with each other, But unfortunately I didn't find any. I go through one by one, Which makes more confusion. It…
5
votes
6 answers

HtmlUnitDriver does not appear to be loading page

I'm trying to get HtmlUnitDriver to work in my development environment. As a beginner, I've tried implementing the example from the following page using the latest selenium server…
Justin
  • 742
  • 5
  • 17
  • 34
5
votes
3 answers

HtmlUnit ScriptException errors

I am using HtmlUnitDriver,& here is my code. HtmlUnitDriver driver = new HtmlUnitDriver(true); driver.get("some url here"); I am getting following Exception: Caused by: com.gargoylesoftware.htmlunit.ScriptException: Wrapped…
dhananjay
  • 321
  • 2
  • 11
  • 20
4
votes
1 answer

How to measure the number of JavaScript functions that define new Strings

I was looking through this paper, in which they use HTMLUnit to "measure the number of invocations of JavaScript functions that can be used to define new strings (such as substring, and fromCharCode), and the number of string uses (such as write…
Rehaan Ahmad
  • 794
  • 8
  • 23
4
votes
1 answer

Read alerts in HTML unit

I am working on HTML unit with Java to read HTML pages. I have a scenario where I have to read messages from the popup/ alert window. I have an index page page = form.getInputByName("index").click(); After I click on the index page I get the…
Shaik Mujahid Ali
  • 2,308
  • 7
  • 26
  • 40
4
votes
1 answer

Htmlunitdriver conflicting with Rest Assured API

I am trying to use Htmlunitdriver but it looks like it is conflicting with Rest Assured API. If i remove rest assured library from the pom.xml, the below code works fine HtmlUnitDriver driver = new HtmlUnitDriver(); If i add rest assured library to…
aby
  • 95
  • 1
  • 11
4
votes
2 answers

HtmlUnitDriver not getting page properly

I'm a newbie at this, basically I'm trying to use the HtmlUnitDriver, this is my code: WebDriver driver = new HtmlUnitDriver(); driver.get("http://www.google.com"); System.out.println(driver.getPageSource()); But the page source I got is:
punkaceratop
  • 178
  • 1
  • 3
  • 10
1
2 3
14 15