Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Java HtmlUnitDriver, the method get() does not load the page #47

Closed
ajimenezv opened this issue Apr 6, 2017 · 4 comments
Closed

Java HtmlUnitDriver, the method get() does not load the page #47

ajimenezv opened this issue Apr 6, 2017 · 4 comments

Comments

@ajimenezv
Copy link

ajimenezv commented Apr 6, 2017

Hi!
I'm having some problems using the driver in a java application, the method get the second time i use it, does not load the page. I'm working on a linux 3.10 machine with java 1.8 and i have the latest distribution of selenium 3.3.1. Here's some the code which im having problems:

DesiredCapabilities cap = new DesiredCapabilities(); cap.setCapability(CapabilityType.PROXY, proxy); cap.setJavascriptEnabled(true); driver = new HtmlUnitDriver(cap); driver.get("http://data.theice.com/MyAccount/Login.aspx?ReturnUrl=~\\ViewData\\Default.aspx");
(... Use some elements...)
Here i simulate a log in process filling the info. and submit the info.

driver.get("http://data.theice.com/ViewData/EndOfDay/FuturesReport.aspx");
<-- Here does not load and remain in the first page.
System.out.println(driver.getTitle());
I tested this solution on a windows machine and it worked normally, however in the linux machine it doesnt load.
I hope you can help me with this problem,
Thank you.

@asashour
Copy link
Contributor

asashour commented Apr 7, 2017

Please provide your complete case.

@ajimenezv
Copy link
Author

ajimenezv commented Apr 10, 2017

Proxy proxy = new Proxy();
proxy.setHttpProxy(ScrapperController.getProxy());

DesiredCapabilities cap = new DesiredCapabilities();
cap.setCapability(CapabilityType.PROXY, proxy);
cap.setJavascriptEnabled(true);
WebElement un;
driver = new HtmlUnitDriver(cap);

driver.get("http://data.theice.com/MyAccount/Login.aspx?ReturnUrl=~\\ViewData\\Default.aspx");
		
un = driver.findElement(By.id("ctl00_ContentPlaceHolder1_LoginControl_m_userName"));
un.sendKeys(getUsername());
	
un = driver.findElement(By.id("ctl00_ContentPlaceHolder1_LoginControl_m_password"));
un.sendKeys(getPwd());
un = driver.findElement(By.id("ctl00_ContentPlaceHolder1_LoginControl_LoginButton"));
System.out.println("1. "+driver.getTitle());
un.click();
			
driver.get("http://data.theice.com/ViewData/EndOfDay/FuturesReport.aspx");

@ajimenezv
Copy link
Author

Java version, 1.8.0_72
Linux machine, 3.10.0 x86_64 GNU/Linux
Selenium version, 3.3.1

@rbri
Copy link
Collaborator

rbri commented Dec 12, 2019

Sorry but this is too old to work on this. Please open a new issue if you still has problems with the latest version.

@rbri rbri closed this as completed Dec 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants