My Java code using html unit is working perfectly fine as I need to open a webpage and fill a form and finally click submit. But when I tried to deploy Java code Jar in Unix, it's unable to find and click on the text input fields/buttons.
So please help regarding this. I am getting a Null Pointer Exception whenever i am trying to fetch an Element by Id,for example :
1) HtmlAnchor addr = (HtmlAnchor) page.getElementById("element_id");
2) page = addr.click();
Getting an error at line 2
I am just export the class as Runnable Jar file and running it on unix java -jar
Please help.