htmlunit - Trying to use HTML Unit through unix server -


my java code using html unit working fine need open webpage , fill form , click submit. when tried deploy java code jar in unix, it's unable find , click on text input fields/buttons.

so please regarding this. getting null pointer exception whenever trying fetch element id,for example :

1) htmlanchor addr = (htmlanchor) page.getelementbyid("element_id");

2) page = addr.click();

getting error @ line 2

i export class runnable jar file , running on unix java -jar

please help.

usually, print page.asxml() see how page seen.

you have network connectivity difference, between running server , machine. hostname vs 'localhost' can cause differences too.

waiting background threads can differ between machines, please read this.

also, please use latest version of htmlunit, can print used version.

hope helps


Comments