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
0
votes
1 answer

Class Cast Exception in htmldriver

When I am loading a webpage in selenium html driver, there is Javascript execution error, but there is also this in the error logs java.lang.ClassCastException: com.gargoylesoftware.htmlunit.javascript.host.Window cannot be cast to …
user1373231
  • 55
  • 1
  • 8
0
votes
2 answers

File Upload using Selenium HtmlUnitDriver-headless webdriver

I'm trying to upload a local file (C:\sample.txt) to my server. I have tried to implement this with Chrome web driver and its working absolutely fine. But during implementing the same with HTMLUnitDriver, i couldn't browse the file item from my…
Diya
  • 43
  • 10
0
votes
0 answers

Selenium/Java program speeding up overtime

I have written a Java program using Selenium HTMLUnitDriver. It consists of a few methods which basically first scrape a site for some elements, then interact with these elements, and then finally fills in and submits a form. I run these few methods…
rahc01
  • 47
  • 7
0
votes
0 answers

Missing Class exception in HTMLUnitDriver (Selenium) when extracting attribute value by XPATH

My invocation looks like this : DesiredCapabilities capabilities = DesiredCapabilities.htmlUnit(); capabilities.setBrowserName("Mozilla/5.0 (Windows NT 6.1; WOW64; rv:25.0) Gecko/20160101 Firefox/66.0"); driver…
ARMV
  • 194
  • 5
0
votes
1 answer

Cannot enable javascript for GWT application using Selenium WebClient or HtmlUnitDriver

I am trying to get the HTML page source in order to test the GUI for a GWT application using headless browser testing. First I tried to get the content of the page using HtmlUnitDriver, like the following: DesiredCapabilities capabilities =…
0
votes
1 answer

How to find HTML elements that match a certain string, using HtmlUnitDriver with java?

I wuold find all HTML element in a page that math a certain string like, for example,
, using HtmlUnitDriver (java). What I would do is a web application, that takes in inputs two parameters: url to search for a pattern…
d3llafr33
  • 347
  • 4
  • 15
0
votes
1 answer

How to handle alert with HtmlUnitDriver in java?

I'm trying to handle alerts event with HtmlUnitDriver, but I have some problems, and I would like to understand why. Here is the java code: HtmlUnitDriver browser = new…
d3llafr33
  • 347
  • 4
  • 15
0
votes
0 answers

How to get the textarea element and its content in HtmlUnit?

I am trying to obtain the content of a element using java and htmlunit but getting some ClassCastException error. Not sure if I am getting this the correct way. Exception: java.lang.ClassCastException: com.gargoylesoftware.htmlunit.html.HtmlMeta…
Nital
  • 5,784
  • 26
  • 103
  • 195
0
votes
1 answer

HtmlUnit: how to extract elements from tag page

I'm trying to automate my routine job. I could see the web shows a lot of elements when inspect a element, but when I click view page source I see only Gibberish words. I want to extract the page element can someone help me. My page sample is…
Dilli
  • 13
  • 6
0
votes
3 answers

Unable to locate an element in Selenium (htmlUnitDriver)

I am unable to locate an element in selenium, which i used htmlUnitDriver. well driver is working fine but I'm unable to find google search text box element. Here is the code: import java.util.concurrent.TimeUnit; import…
sandeep kumar
  • 195
  • 1
  • 4
  • 20
0
votes
0 answers

Htmlunitdriver not able to open page which is based on sockets

Code: public static void main(String[] args) { WebDriver webDriver = new HtmlUnitDriver(true); webDriver.get("https://www.crowdchat.net/chat/c3BvdF9vYmpfMjE2MQ=="); } URL: https://www.crowdchat.net/chat/c3BvdF9vYmpfMjE2MQ== Above code is…
yojna
  • 503
  • 1
  • 5
  • 17
0
votes
1 answer

Why does HtmlUnitDriver fail randomly (FirefoxDriver/ChromeDriver works)?

I have one 2 min script for Selenium webdriver. It works very fine with FirefoxDriver and ChromeDriver. It never gets fails with real browser. But when I run with HTMLUnit driver I have found Its fails randomly. Throws exception like not able to…
Sagar007
  • 848
  • 1
  • 13
  • 33
0
votes
2 answers

Usage of TestNg, HtmlUnitDriver, selenium, Java and Eclipse

I'm trying to run a very simple code that retrieves the title of a page and uses assertion but in a Headless Browser. I'm using HTML Unit Driver. I will show my code, the libraries included and the result. I know the test case should be a pass but…
0
votes
1 answer

Having Difficulty in runnig the selenium script with HTMLUnitDriver

I had writen a selenium script for automation, and I am using HTMLUnitDriver for running it on linux as headless browsing. I had some concern - When I try to run my same script with WebDriver, i.e WebDriver driver = new FirefoxDriver() it runs…
Rishi Arora
  • 1,713
  • 3
  • 16
  • 31
0
votes
0 answers

Python webdriver Htmlunit // Find_element_by_id make me an error

I would like Find_element_by_id on paypal in order to confirm the checkout, but I'm getting an error. I use a working code with webdriver Chrome and Opera: confirmButton = browser.wait.until( EC.presence_of_element_located((By.ID,…