Microsoft
Software
Hardware
Network
Question : pop up windows in htmlUnit, click on them
Hi there,
After clicking a button on a page, a pop-up window opens (generated by javascript).
I need to click on a button inside this pop up window to go to the next page.
I don't know how to get hold of the source of this pop up window so I can click the button.
If I want to retrieve the source code of any html page I use the following code:
String htmlBody = page.getWebResponse().getC
ontentAsSt
ring();
//Save the response in a file
String filePath = "c:/Ana/out.html";
BufferedWriter bw = new BufferedWriter(new FileWriter(new File(filePath)));
bw.write(htmlBody);
bw.close();
But this does't get me the code for the pop up window.
Any ideas how to handle pop-ups un HtmlUnit?
Also, after clicking the button I get this warning:
22-Jul-2010 15:19:33 com.gargoylesoftware.htmlu
nit.javasc
ript.host.
Window jsxFunction_confirm
WARNING: window.confirm("This operation will create new project document! Proceed?") no confirm handler installed, simulating the OK button
Interestingly enough, in this warning I can read what I see on the popup window. I wonder if I need to use a handler to grab the code of the pop up window.
Thank you,
Ana
Related Solutions:
Find button on form
Pop up windows in HtmlUnit
Answer : pop up windows in htmlUnit, click on them
ConfirmHandler okHandler = new ConfirmHandler() {
boolean handleConfirm(Page page, String message) {
return true;
}
};
Random Solutions
How to assign limited access server login to SBS 2008
How to get an ObjId if you have an SPID - Stored Procedure
Copy and Paste data
Report Generation [Access]
Re-Generate Self Signed SSL Certificate - Exchange 2007
editing text on a gif in photoshop
Deploying printers group policy server 2003 and server 2008
Best way to search desktops for a file?
zip hot backup files as they are created
problem with button and web service. (save as problem)