From: Ahmed A. <asa...@ya...> - 2015-08-13 17:47:10
|
Hi again, There are no POST requests by Charles for the below code. Please post your code and provide compared results. Ahmed @Test public void testRichFacesFileUpload() throws Exception { final CollectingAlertHandler handler = new CollectingAlertHandler(); try (final WebClient webClient = new WebClient(BrowserVersion.CHROME, "localhost", 8888)){ webClient.setAlertHandler(handler); webClient.setAjaxController(new NicelyResynchronizingAjaxController()); String url = "http://showcase.richfaces.org/richfaces/component-sample.jsf?demo=fileUpload&skin=blueSky"; HtmlPage page = webClient.getPage(url); // choose file to upload HtmlInput htmlInput = (HtmlInput) page.getByXPath("//input[@type='file']").get(0); page = (HtmlPage) htmlInput.setValueAttribute("C:\\use\\chrome.PNG"); // click Upload button HtmlElement element = (HtmlElement) page.getByXPath( "//*[@id='j_idt1245:upload']/div[1]/span[1]/span[2]/span").get( 0); page = (HtmlPage) element.click(); } catch(Exception e) { System.out.println(e.getMessage()); } for (String x : handler.getCollectedAlerts()) { System.err.println(x); } } From: "Parham, Clinton" <cp...@bi...> To: Ahmed Ashour <asa...@ya...>; "htm...@li..." <htm...@li...> Sent: Thursday, August 13, 2015 5:12 AM Subject: Re: [Htmlunit-user] RichFaces 4 fileUpload Hi Ahmed, I have tested with the snapshot and get further. I no longer get script errors but the upload still doesn’t work. I’ve looked at the raw POST requests from HTMLUnit and compared to Firefox using Charles Proxy. They are quite different. I captured the requests when clicking the Upload button. Can you take a look and see what you think the problem might be? Thank you. #yiv6884170387 #yiv6884170387 -- _filtered #yiv6884170387 {font-family:Helvetica;panose-1:2 11 6 4 2 2 2 2 2 4;} _filtered #yiv6884170387 {font-family:Helvetica;panose-1:2 11 6 4 2 2 2 2 2 4;} _filtered #yiv6884170387 {font-family:Calibri;panose-1:2 15 5 2 2 2 4 3 2 4;} _filtered #yiv6884170387 {font-family:Tahoma;panose-1:2 11 6 4 3 5 4 4 2 4;} _filtered #yiv6884170387 {font-family:HelveticaNeue;}#yiv6884170387 #yiv6884170387 p.yiv6884170387MsoNormal, #yiv6884170387 li.yiv6884170387MsoNormal, #yiv6884170387 div.yiv6884170387MsoNormal {margin:0in;margin-bottom:.0001pt;font-size:12.0pt;}#yiv6884170387 a:link, #yiv6884170387 span.yiv6884170387MsoHyperlink {color:blue;text-decoration:underline;}#yiv6884170387 a:visited, #yiv6884170387 span.yiv6884170387MsoHyperlinkFollowed {color:purple;text-decoration:underline;}#yiv6884170387 p.yiv6884170387msoacetate, #yiv6884170387 li.yiv6884170387msoacetate, #yiv6884170387 div.yiv6884170387msoacetate {margin-right:0in;margin-left:0in;font-size:12.0pt;}#yiv6884170387 p.yiv6884170387msonormal, #yiv6884170387 li.yiv6884170387msonormal, #yiv6884170387 div.yiv6884170387msonormal {margin-right:0in;margin-left:0in;font-size:12.0pt;}#yiv6884170387 p.yiv6884170387msonormal1, #yiv6884170387 li.yiv6884170387msonormal1, #yiv6884170387 div.yiv6884170387msonormal1 {margin-right:0in;margin-left:0in;font-size:12.0pt;}#yiv6884170387 p.yiv6884170387msochpdefault, #yiv6884170387 li.yiv6884170387msochpdefault, #yiv6884170387 div.yiv6884170387msochpdefault {margin-right:0in;margin-left:0in;font-size:12.0pt;}#yiv6884170387 span.yiv6884170387msohyperlink {}#yiv6884170387 span.yiv6884170387msohyperlinkfollowed {}#yiv6884170387 span.yiv6884170387msohyperlink1 {}#yiv6884170387 span.yiv6884170387msohyperlinkfollowed1 {}#yiv6884170387 span.yiv6884170387emailstyle171 {}#yiv6884170387 span.yiv6884170387emailstyle27 {}#yiv6884170387 p.yiv6884170387msonormal2, #yiv6884170387 li.yiv6884170387msonormal2, #yiv6884170387 div.yiv6884170387msonormal2 {margin:0in;margin-bottom:.0001pt;font-size:12.0pt;}#yiv6884170387 span.yiv6884170387msohyperlink2 {color:blue;text-decoration:underline;}#yiv6884170387 span.yiv6884170387msohyperlinkfollowed2 {color:purple;text-decoration:underline;}#yiv6884170387 p.yiv6884170387msoacetate1, #yiv6884170387 li.yiv6884170387msoacetate1, #yiv6884170387 div.yiv6884170387msoacetate1 {margin:0in;margin-bottom:.0001pt;font-size:8.0pt;}#yiv6884170387 p.yiv6884170387msonormal3, #yiv6884170387 li.yiv6884170387msonormal3, #yiv6884170387 div.yiv6884170387msonormal3 {margin-right:0in;margin-left:0in;font-size:12.0pt;}#yiv6884170387 p.yiv6884170387msonormal11, #yiv6884170387 li.yiv6884170387msonormal11, #yiv6884170387 div.yiv6884170387msonormal11 {margin:0in;margin-bottom:.0001pt;font-size:11.0pt;}#yiv6884170387 span.yiv6884170387msohyperlink11 {color:blue;text-decoration:underline;}#yiv6884170387 span.yiv6884170387msohyperlinkfollowed11 {color:purple;text-decoration:underline;}#yiv6884170387 span.yiv6884170387emailstyle1711 {color:windowtext;}#yiv6884170387 span.yiv6884170387emailstyle271 {color:#1F497D;}#yiv6884170387 p.yiv6884170387msochpdefault1, #yiv6884170387 li.yiv6884170387msochpdefault1, #yiv6884170387 div.yiv6884170387msochpdefault1 {margin-right:0in;margin-left:0in;font-size:10.0pt;}#yiv6884170387 span.yiv6884170387EmailStyle38 {color:#1F497D;}#yiv6884170387 .yiv6884170387MsoChpDefault {font-size:10.0pt;} _filtered #yiv6884170387 {margin:1.0in 1.0in 1.0in 1.0in;}#yiv6884170387 div.yiv6884170387WordSection1 {}#yiv6884170387 |