From: Ahmed A. <asa...@ya...> - 2015-08-06 22:39:17
|
Hi, You can use "alert(arguments.callee.caller);" Please read some hints in http://htmlunit.sourceforge.net/submittingJSBugs.html#JavaScript_hints Ahmed From: "Parham, Clinton" <cp...@bi...> To: "htm...@li..." <htm...@li...> Sent: Thursday, August 6, 2015 10:41 PM Subject: [Htmlunit-user] RichFaces 4 fileUpload This message is eligible for Automatic Cleanup! (cp...@bi...) Add cleanup rule | More info <!--#yiv1812243964 _filtered #yiv1812243964 {font-family:Calibri;panose-1:2 15 5 2 2 2 4 3 2 4;}#yiv1812243964 #yiv1812243964 p.yiv1812243964MsoNormal, #yiv1812243964 li.yiv1812243964MsoNormal, #yiv1812243964 div.yiv1812243964MsoNormal {margin:0in;margin-bottom:.0001pt;font-size:11.0pt;font-family:"Calibri", "sans-serif";}#yiv1812243964 a:link, #yiv1812243964 span.yiv1812243964MsoHyperlink {color:blue;text-decoration:underline;}#yiv1812243964 a:visited, #yiv1812243964 span.yiv1812243964MsoHyperlinkFollowed {color:purple;text-decoration:underline;}#yiv1812243964 span.yiv1812243964EmailStyle17 {font-family:"Calibri", "sans-serif";color:windowtext;}#yiv1812243964 .yiv1812243964MsoChpDefault {} _filtered #yiv1812243964 {margin:1.0in 1.0in 1.0in 1.0in;}#yiv1812243964 div.yiv1812243964WordSection1 {}-->Hello, I continue to struggle to get the RichFaces fileUpload component to work with HTMLUnit 2.18. (http://showcase.richfaces.org/richfaces/component-sample.jsf?demo=fileUpload&skin=blueSky) After setting the file to upload with htmlInput.setValueAttribute and clicking the Upload button, I get this error from HTMLUnit: 2015-08-06 15:23:58,744 INFO main [com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine][handleJavaScriptException] Caught script exception ======= EXCEPTION START ======== EcmaError: lineNumber=[403] column=[0] lineSource=[null] name=[TypeError] sourceName=[https://bio206/saas/org.richfaces.resources/javax.faces.resource/org.richfaces/fileupload.js] message=[TypeError: Cannot read property "target" from undefined (https://bio206/saas/org.richfaces.resources/javax.faces.resource/org.richfaces/fileupload.js#403)] com.gargoylesoftware.htmlunit.ScriptException: TypeError: Cannot read property "target" from undefined (https://bio206/saas/org.richfaces.resources/javax.faces.resource/org.richfaces/fileupload.js#403) at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$HtmlUnitContextAction.run(JavaScriptEngine.java:865) at net.sourceforge.htmlunit.corejs.javascript.Context.call(Context.java:628) … == CALLING JAVASCRIPT == function () { return fn.apply(context || this, args.concat(slice.call(arguments))); } ======= EXCEPTION END ======== I’ve tried debugging and all that I can tell is that “e” is undefined on this line #403 in fileupload.js: switch (e.target.status) { The function in fileupload.js is called from jquery.js but I cannot trace the argument to better understand why it’s undefined when HTMLUnit is running. I’ve attached a testcase. Any suggestions? Thanks, Clint | The contents contained herein may contain confidential information. If you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution, printing or action taken on the contents is strictly prohibited. If you have received this email in error, please notify the sender immediately and delete this message. | ------------------------------------------------------------------------------ _______________________________________________ Htmlunit-user mailing list Htm...@li... https://lists.sourceforge.net/lists/listinfo/htmlunit-user |
From: Ahmed A. <asa...@ya...> - 2015-08-11 09:58:25
|
Hi Clinton, Debugging in Chrome doesn't help, because it is needed to also see how HtmlUnit behaves. Please read the full page of [1] for future issues. The reported issue is because 'arguments[0]' was 'undefined' in HtmlUnit, but not in real browsers. This is now fixed in SVN, you can get latest snapshot form [2] once a successful build is made. Thanks,Ahmed [1] http://htmlunit.sourceforge.net/submittingJSBugs.html[2] https://ci.canoo.com/teamcity/viewLog.html?buildTypeId=HtmlUnit_FastBuild&buildId=lastSuccessful&tab=artifacts From: "Parham, Clinton" <cp...@bi...> To: Ahmed Ashour <asa...@ya...>; "htm...@li..." <htm...@li...> Sent: Saturday, August 8, 2015 3:46 AM Subject: Re: [Htmlunit-user] RichFaces 4 fileUpload #yiv0880478526 #yiv0880478526 -- _filtered #yiv0880478526 {font-family:Helvetica;panose-1:2 11 6 4 2 2 2 2 2 4;} _filtered #yiv0880478526 {font-family:Helvetica;panose-1:2 11 6 4 2 2 2 2 2 4;} _filtered #yiv0880478526 {font-family:Calibri;panose-1:2 15 5 2 2 2 4 3 2 4;} _filtered #yiv0880478526 {font-family:Tahoma;panose-1:2 11 6 4 3 5 4 4 2 4;} _filtered #yiv0880478526 {font-family:HelveticaNeue;}#yiv0880478526 #yiv0880478526 p.yiv0880478526MsoNormal, #yiv0880478526 li.yiv0880478526MsoNormal, #yiv0880478526 div.yiv0880478526MsoNormal {margin:0in;margin-bottom:.0001pt;font-size:12.0pt;}#yiv0880478526 a:link, #yiv0880478526 span.yiv0880478526MsoHyperlink {color:blue;text-decoration:underline;}#yiv0880478526 a:visited, #yiv0880478526 span.yiv0880478526MsoHyperlinkFollowed {color:purple;text-decoration:underline;}#yiv0880478526 p.yiv0880478526MsoAcetate, #yiv0880478526 li.yiv0880478526MsoAcetate, #yiv0880478526 div.yiv0880478526MsoAcetate {margin:0in;margin-bottom:.0001pt;font-size:8.0pt;}#yiv0880478526 p.yiv0880478526msonormal, #yiv0880478526 li.yiv0880478526msonormal, #yiv0880478526 div.yiv0880478526msonormal {margin-right:0in;margin-left:0in;font-size:12.0pt;}#yiv0880478526 span.yiv0880478526msohyperlink {}#yiv0880478526 span.yiv0880478526msohyperlinkfollowed {}#yiv0880478526 span.yiv0880478526emailstyle17 {}#yiv0880478526 p.yiv0880478526msonormal1, #yiv0880478526 li.yiv0880478526msonormal1, #yiv0880478526 div.yiv0880478526msonormal1 {margin:0in;margin-bottom:.0001pt;font-size:11.0pt;}#yiv0880478526 span.yiv0880478526msohyperlink1 {color:blue;text-decoration:underline;}#yiv0880478526 span.yiv0880478526msohyperlinkfollowed1 {color:purple;text-decoration:underline;}#yiv0880478526 span.yiv0880478526emailstyle171 {color:windowtext;}#yiv0880478526 span.yiv0880478526BalloonTextChar {}#yiv0880478526 span.yiv0880478526EmailStyle27 {color:#1F497D;}#yiv0880478526 .yiv0880478526MsoChpDefault {font-size:10.0pt;} _filtered #yiv0880478526 {margin:1.0in 1.0in 1.0in 1.0in;}#yiv0880478526 div.yiv0880478526WordSection1 {}#yiv0880478526 Hi Ahmed, Debugging the code, I have a call stack that is only two levels deep. I’ve taken browser screenshots of the code at fileupload.js#403 (where HTMLUnit says “e” is undefined) and another screenshot of the code calling fileupload from jquery.js#547. The jquery code passes “arguments” as the parameter to fileupload.js. So I’m assuming that “arguments” is for some reason undefined when running HTMLUnit test. Why, I don’t know. Can you suggest something? Thank you. From: Ahmed Ashour [mailto:asa...@ya...] Sent: Thursday, August 06, 2015 6:36 PM To: htm...@li... Subject: Re: [Htmlunit-user] RichFaces 4 fileUpload Hi, You can use "alert(arguments.callee.caller);" Please read some hints in http://htmlunit.sourceforge.net/submittingJSBugs.html#JavaScript_hints Ahmed |
From: Parham, C. <cp...@bi...> - 2015-08-13 03:12:21
Attachments:
HTMLUnitFileUpload.txt
HTMLUnitTestCase.java
|
POST /richfaces/component-sample.jsf;jsessionid=soXVJJpi8TGUWCqroxWFApTB?rf_fu_uid=0.8202501885813719&javax.faces.partial.ajax=true&javax.faces.source=j_idt1735:upload&javax.faces.partial.execute=j_idt1735:upload&org.richfaces.ajax.component=j_idt1735:upload&javax.faces.ViewState=4851658137619826044:-2769993515735120836 HTTP/1.1 X-Sophos-Filter: 0012b287c92f1d4abb2ac36be4149c10762d7d6e Host: showcase.richfaces.org User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:39.0) Gecko/20100101 Firefox/39.0 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 Accept-Language: en-US,en;q=0.5 Accept-Encoding: gzip, deflate Faces-Request: partial/ajax Referer: http://showcase.richfaces.org/richfaces/component-sample.jsf?demo=fileUpload&skin=blueSky Content-Length: 6814 Content-Type: multipart/form-data; boundary=---------------------------176561721431339 Cookie: __utma=143911734.1939771183.1381857271.1438891755.1439394268.19; __utmz=143911734.1435709828.15.1.utmcsr=google|utmccn=(organic)|utmcmd=organic|utmctr=(not%20provided); JSESSIONID=soXVJJpi8TGUWCqroxWFApTB; __utmc=143911734 Connection: keep-alive Pragma: no-cache Cache-Control: no-cache -----------------------------176561721431339 Content-Disposition: form-data; name="j_idt1735" j_idt1735 -----------------------------176561721431339 Content-Disposition: form-data; name="javax.faces.ViewState" 4851658137619826044:-2769993515735120836 -----------------------------176561721431339 Content-Disposition: form-data; name="j_idt1735:upload"; filename="KYN_TopLeft.PNG" Content-Type: image/png ÂPNG |
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 |
From: Parham, C. <cp...@bi...> - 2015-08-13 18:17:32
|
Hi Ahmed, I did attach three files to my earlier email: FirefoxFileUpload.txt – shows POST that Charles captured for FireFox HTMLUnitFileUpload.txt – shows POST that Charles captured for HTMLUnit HTMLUnitTestCase.java – code to reproduce I see them attached in my Sent Items. Should I send them another way? Also, the id that you have in your code “j_idt1245:upload” sometimes changes on the site when they update it. Today the id is “j_idt498:upload”. Thanks. From: Ahmed Ashour [mailto:asa...@ya...] Sent: Thursday, August 13, 2015 1:44 PM To: htm...@li... Subject: Re: [Htmlunit-user] RichFaces 4 fileUpload 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...<mailto:cp...@bi...>> To: Ahmed Ashour <asa...@ya...<mailto:asa...@ya...>>; "htm...@li...<mailto:htm...@li...>" <htm...@li...<mailto: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. ________________________________ The contents contained herein may contain confidential information. If you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution, printing or action taken on the contents is strictly prohibited. If you have received this email in error, please notify the sender immediately and delete this message. |
From: Parham, C. <cp...@bi...> - 2015-08-20 13:15:28
|
Hi Ahmed, Did you find my attachments and see the POST requests? Thank you, Clint From: Parham, Clinton Sent: Thursday, August 13, 2015 2:12 PM To: 'Ahmed Ashour'; htm...@li... Subject: RE: [Htmlunit-user] RichFaces 4 fileUpload Hi Ahmed, I did attach three files to my earlier email: FirefoxFileUpload.txt – shows POST that Charles captured for FireFox HTMLUnitFileUpload.txt – shows POST that Charles captured for HTMLUnit HTMLUnitTestCase.java – code to reproduce I see them attached in my Sent Items. Should I send them another way? Also, the id that you have in your code “j_idt1245:upload” sometimes changes on the site when they update it. Today the id is “j_idt498:upload”. Thanks. From: Ahmed Ashour [mailto:asa...@ya...] Sent: Thursday, August 13, 2015 1:44 PM To: htm...@li...<mailto:htm...@li...> Subject: Re: [Htmlunit-user] RichFaces 4 fileUpload 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); } } ________________________________ The contents contained herein may contain confidential information. If you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution, printing or action taken on the contents is strictly prohibited. If you have received this email in error, please notify the sender immediately and delete this message. |
From: Ahmed A. <asa...@ya...> - 2015-08-24 02:13:19
|
Hi Clinton, >> Did you find my attachments and see the POST requests? Yes I did, but there was no POST request triggered by HtmlUnit with me. I even enabled HttpComponents header logging, and all requests are GET. Please try the below code, which I used. @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); } } Ahmed From: "Parham, Clinton" <cp...@bi...> To: Ahmed Ashour <asa...@ya...>; "htm...@li..." <htm...@li...> Sent: Thursday, August 20, 2015 3:15 PM Subject: Re: [Htmlunit-user] RichFaces 4 fileUpload <!--#yiv6103805429 _filtered #yiv6103805429 {font-family:Calibri;panose-1:2 15 5 2 2 2 4 3 2 4;} _filtered #yiv6103805429 {font-family:Tahoma;panose-1:2 11 6 4 3 5 4 4 2 4;} _filtered #yiv6103805429 {font-family:HelveticaNeue;}#yiv6103805429 #yiv6103805429 p.yiv6103805429MsoNormal, #yiv6103805429 li.yiv6103805429MsoNormal, #yiv6103805429 div.yiv6103805429MsoNormal {margin:0in;margin-bottom:.0001pt;font-size:12.0pt;font-family:"Times New Roman", "serif";}#yiv6103805429 a:link, #yiv6103805429 span.yiv6103805429MsoHyperlink {color:blue;text-decoration:underline;}#yiv6103805429 a:visited, #yiv6103805429 span.yiv6103805429MsoHyperlinkFollowed {color:purple;text-decoration:underline;}#yiv6103805429 p.yiv6103805429MsoAcetate, #yiv6103805429 li.yiv6103805429MsoAcetate, #yiv6103805429 div.yiv6103805429MsoAcetate {margin:0in;margin-bottom:.0001pt;font-size:8.0pt;font-family:"Tahoma", "sans-serif";}#yiv6103805429 span.yiv6103805429BalloonTextChar {font-family:"Tahoma", "sans-serif";}#yiv6103805429 p.yiv6103805429msoacetate, #yiv6103805429 li.yiv6103805429msoacetate, #yiv6103805429 div.yiv6103805429msoacetate {margin-right:0in;margin-left:0in;font-size:12.0pt;font-family:"Times New Roman", "serif";}#yiv6103805429 p.yiv6103805429msonormal, #yiv6103805429 li.yiv6103805429msonormal, #yiv6103805429 div.yiv6103805429msonormal {margin-right:0in;margin-left:0in;font-size:12.0pt;font-family:"Times New Roman", "serif";}#yiv6103805429 p.yiv6103805429msonormal1, #yiv6103805429 li.yiv6103805429msonormal1, #yiv6103805429 div.yiv6103805429msonormal1 {margin-right:0in;margin-left:0in;font-size:12.0pt;font-family:"Times New Roman", "serif";}#yiv6103805429 p.yiv6103805429msochpdefault, #yiv6103805429 li.yiv6103805429msochpdefault, #yiv6103805429 div.yiv6103805429msochpdefault {margin-right:0in;margin-left:0in;font-size:12.0pt;font-family:"Times New Roman", "serif";}#yiv6103805429 p.yiv6103805429msonormal2, #yiv6103805429 li.yiv6103805429msonormal2, #yiv6103805429 div.yiv6103805429msonormal2 {margin-right:0in;margin-left:0in;font-size:12.0pt;font-family:"Times New Roman", "serif";}#yiv6103805429 p.yiv6103805429msoacetate1, #yiv6103805429 li.yiv6103805429msoacetate1, #yiv6103805429 div.yiv6103805429msoacetate1 {margin-right:0in;margin-left:0in;font-size:12.0pt;font-family:"Times New Roman", "serif";}#yiv6103805429 p.yiv6103805429msonormal3, #yiv6103805429 li.yiv6103805429msonormal3, #yiv6103805429 div.yiv6103805429msonormal3 {margin-right:0in;margin-left:0in;font-size:12.0pt;font-family:"Times New Roman", "serif";}#yiv6103805429 p.yiv6103805429msonormal11, #yiv6103805429 li.yiv6103805429msonormal11, #yiv6103805429 div.yiv6103805429msonormal11 {margin-right:0in;margin-left:0in;font-size:12.0pt;font-family:"Times New Roman", "serif";}#yiv6103805429 p.yiv6103805429msochpdefault1, #yiv6103805429 li.yiv6103805429msochpdefault1, #yiv6103805429 div.yiv6103805429msochpdefault1 {margin-right:0in;margin-left:0in;font-size:12.0pt;font-family:"Times New Roman", "serif";}#yiv6103805429 p.yiv6103805429msonormal4, #yiv6103805429 li.yiv6103805429msonormal4, #yiv6103805429 div.yiv6103805429msonormal4 {margin:0in;margin-bottom:.0001pt;font-size:12.0pt;font-family:"Times New Roman", "serif";}#yiv6103805429 p.yiv6103805429msoacetate2, #yiv6103805429 li.yiv6103805429msoacetate2, #yiv6103805429 div.yiv6103805429msoacetate2 {margin-right:0in;margin-left:0in;font-size:12.0pt;font-family:"Times New Roman", "serif";}#yiv6103805429 p.yiv6103805429msonormal5, #yiv6103805429 li.yiv6103805429msonormal5, #yiv6103805429 div.yiv6103805429msonormal5 {margin-right:0in;margin-left:0in;font-size:12.0pt;font-family:"Times New Roman", "serif";}#yiv6103805429 p.yiv6103805429msonormal12, #yiv6103805429 li.yiv6103805429msonormal12, #yiv6103805429 div.yiv6103805429msonormal12 {margin-right:0in;margin-left:0in;font-size:12.0pt;font-family:"Times New Roman", "serif";}#yiv6103805429 p.yiv6103805429msochpdefault2, #yiv6103805429 li.yiv6103805429msochpdefault2, #yiv6103805429 div.yiv6103805429msochpdefault2 {margin-right:0in;margin-left:0in;font-size:12.0pt;font-family:"Times New Roman", "serif";}#yiv6103805429 p.yiv6103805429msonormal21, #yiv6103805429 li.yiv6103805429msonormal21, #yiv6103805429 div.yiv6103805429msonormal21 {margin:0in;margin-bottom:.0001pt;font-size:12.0pt;font-family:"Times New Roman", "serif";}#yiv6103805429 p.yiv6103805429msoacetate11, #yiv6103805429 li.yiv6103805429msoacetate11, #yiv6103805429 div.yiv6103805429msoacetate11 {margin:0in;margin-bottom:.0001pt;font-size:8.0pt;font-family:"Times New Roman", "serif";}#yiv6103805429 p.yiv6103805429msonormal31, #yiv6103805429 li.yiv6103805429msonormal31, #yiv6103805429 div.yiv6103805429msonormal31 {margin-right:0in;margin-left:0in;font-size:12.0pt;font-family:"Times New Roman", "serif";}#yiv6103805429 p.yiv6103805429msonormal111, #yiv6103805429 li.yiv6103805429msonormal111, #yiv6103805429 div.yiv6103805429msonormal111 {margin:0in;margin-bottom:.0001pt;font-size:11.0pt;font-family:"Times New Roman", "serif";}#yiv6103805429 p.yiv6103805429msochpdefault11, #yiv6103805429 li.yiv6103805429msochpdefault11, #yiv6103805429 div.yiv6103805429msochpdefault11 {margin-right:0in;margin-left:0in;font-size:10.0pt;font-family:"Times New Roman", "serif";}#yiv6103805429 span.yiv6103805429msohyperlink {}#yiv6103805429 span.yiv6103805429msohyperlinkfollowed {}#yiv6103805429 span.yiv6103805429msohyperlink2 {}#yiv6103805429 span.yiv6103805429msohyperlinkfollowed2 {}#yiv6103805429 span.yiv6103805429msohyperlink11 {}#yiv6103805429 span.yiv6103805429msohyperlinkfollowed11 {}#yiv6103805429 span.yiv6103805429emailstyle1711 {}#yiv6103805429 span.yiv6103805429emailstyle271 {}#yiv6103805429 span.yiv6103805429emailstyle38 {}#yiv6103805429 span.yiv6103805429msohyperlink1 {color:blue;text-decoration:underline;}#yiv6103805429 span.yiv6103805429msohyperlinkfollowed1 {color:purple;text-decoration:underline;}#yiv6103805429 span.yiv6103805429msohyperlink21 {color:blue;text-decoration:underline;}#yiv6103805429 span.yiv6103805429msohyperlinkfollowed21 {color:purple;text-decoration:underline;}#yiv6103805429 span.yiv6103805429msohyperlink111 {color:blue;text-decoration:underline;}#yiv6103805429 span.yiv6103805429msohyperlinkfollowed111 {color:purple;text-decoration:underline;}#yiv6103805429 span.yiv6103805429emailstyle17111 {color:windowtext;}#yiv6103805429 span.yiv6103805429emailstyle2711 {color:#1F497D;}#yiv6103805429 span.yiv6103805429emailstyle381 {color:#1F497D;}#yiv6103805429 span.yiv6103805429EmailStyle56 {font-family:"Calibri", "sans-serif";color:#1F497D;}#yiv6103805429 span.yiv6103805429EmailStyle57 {font-family:"Calibri", "sans-serif";color:#1F497D;}#yiv6103805429 .yiv6103805429MsoChpDefault {font-size:10.0pt;} _filtered #yiv6103805429 {margin:1.0in 1.0in 1.0in 1.0in;}#yiv6103805429 div.yiv6103805429WordSection1 {}-->Hi Ahmed, Did you find my attachments and see the POST requests? Thank you, Clint From: Parham, Clinton Sent: Thursday, August 13, 2015 2:12 PM To: 'Ahmed Ashour'; htm...@li... Subject: RE: [Htmlunit-user] RichFaces 4 fileUpload Hi Ahmed, I did attach three files to my earlier email: FirefoxFileUpload.txt – shows POST that Charles captured for FireFox HTMLUnitFileUpload.txt – shows POST that Charles captured for HTMLUnit HTMLUnitTestCase.java – code to reproduce I see them attached in my Sent Items. Should I send them another way? Also, the id that you have in your code “j_idt1245:upload” sometimes changes on the site when they update it. Today the id is “j_idt498:upload”. Thanks. From: Ahmed Ashour [mailto:asa...@ya...] Sent: Thursday, August 13, 2015 1:44 PM To: htm...@li... Subject: Re: [Htmlunit-user] RichFaces 4 fileUpload 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, C. <cp...@bi...> - 2015-08-24 14:32:06
|
Hi Ahmed, The reason your code isn’t producing a POST is because you are using an outdated element ID: ‘j_idt1245:upload’. This element ID changes whenever the website maintainers push new code out. So today, the ID is 'j_idt1269:upload'. I tried highlighting this in an earlier reply but maybe you missed it. Please try again while ensuring you’re using the current element ID. Thank you kindly, Clint From: Ahmed Ashour [mailto:asa...@ya...] Sent: Sunday, August 23, 2015 10:13 PM To: htm...@li... Subject: Re: [Htmlunit-user] RichFaces 4 fileUpload Hi Clinton, >> Did you find my attachments and see the POST requests? Yes I did, but there was no POST request triggered by HtmlUnit with me. I even enabled HttpComponents header logging, and all requests are GET. … ________________________________ The contents contained herein may contain confidential information. If you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution, printing or action taken on the contents is strictly prohibited. If you have received this email in error, please notify the sender immediately and delete this message. |
From: Ahmed A. <asa...@ya...> - 2015-08-24 17:01:08
|
Hi Clinton, Thanks for clarifying. Handling this has been just fixed in SVN. Please update if you still have an issue. Thanks,Ahmed From: "Parham, Clinton" <cp...@bi...> To: Ahmed Ashour <asa...@ya...>; "htm...@li..." <htm...@li...> Sent: Monday, August 24, 2015 4:31 PM Subject: Re: [Htmlunit-user] RichFaces 4 fileUpload Hi Ahmed, The reason your code isn’t producing a POST is because you are using an outdated element ID: ‘j_idt1245:upload’. This element ID changes whenever the website maintainers push new code out. So today, the ID is 'j_idt1269:upload'. I tried highlighting this in an earlier reply but maybe you missed it. Please try again while ensuring you’re using the current element ID. Thank you kindly, Clint #yiv6018586641 #yiv6018586641 -- _filtered #yiv6018586641 {font-family:Calibri;panose-1:2 15 5 2 2 2 4 3 2 4;} _filtered #yiv6018586641 {font-family:Tahoma;panose-1:2 11 6 4 3 5 4 4 2 4;} _filtered #yiv6018586641 {font-family:HelveticaNeue;panose-1:0 0 0 0 0 0 0 0 0 0;}#yiv6018586641 #yiv6018586641 p.yiv6018586641MsoNormal, #yiv6018586641 li.yiv6018586641MsoNormal, #yiv6018586641 div.yiv6018586641MsoNormal {margin:0in;margin-bottom:.0001pt;font-size:12.0pt;}#yiv6018586641 a:link, #yiv6018586641 span.yiv6018586641MsoHyperlink {color:blue;text-decoration:underline;}#yiv6018586641 a:visited, #yiv6018586641 span.yiv6018586641MsoHyperlinkFollowed {color:purple;text-decoration:underline;}#yiv6018586641 p.yiv6018586641MsoAcetate, #yiv6018586641 li.yiv6018586641MsoAcetate, #yiv6018586641 div.yiv6018586641MsoAcetate {margin:0in;margin-bottom:.0001pt;font-size:8.0pt;}#yiv6018586641 span.yiv6018586641BalloonTextChar {}#yiv6018586641 p.yiv6018586641msoacetate, #yiv6018586641 li.yiv6018586641msoacetate, #yiv6018586641 div.yiv6018586641msoacetate {margin-right:0in;margin-left:0in;font-size:12.0pt;}#yiv6018586641 p.yiv6018586641msonormal, #yiv6018586641 li.yiv6018586641msonormal, #yiv6018586641 div.yiv6018586641msonormal {margin-right:0in;margin-left:0in;font-size:12.0pt;}#yiv6018586641 p.yiv6018586641msonormal1, #yiv6018586641 li.yiv6018586641msonormal1, #yiv6018586641 div.yiv6018586641msonormal1 {margin-right:0in;margin-left:0in;font-size:12.0pt;}#yiv6018586641 p.yiv6018586641msochpdefault, #yiv6018586641 li.yiv6018586641msochpdefault, #yiv6018586641 div.yiv6018586641msochpdefault {margin-right:0in;margin-left:0in;font-size:12.0pt;}#yiv6018586641 p.yiv6018586641msonormal2, #yiv6018586641 li.yiv6018586641msonormal2, #yiv6018586641 div.yiv6018586641msonormal2 {margin-right:0in;margin-left:0in;font-size:12.0pt;}#yiv6018586641 p.yiv6018586641msoacetate1, #yiv6018586641 li.yiv6018586641msoacetate1, #yiv6018586641 div.yiv6018586641msoacetate1 {margin-right:0in;margin-left:0in;font-size:12.0pt;}#yiv6018586641 p.yiv6018586641msonormal3, #yiv6018586641 li.yiv6018586641msonormal3, #yiv6018586641 div.yiv6018586641msonormal3 {margin-right:0in;margin-left:0in;font-size:12.0pt;}#yiv6018586641 p.yiv6018586641msonormal11, #yiv6018586641 li.yiv6018586641msonormal11, #yiv6018586641 div.yiv6018586641msonormal11 {margin-right:0in;margin-left:0in;font-size:12.0pt;}#yiv6018586641 p.yiv6018586641msochpdefault1, #yiv6018586641 li.yiv6018586641msochpdefault1, #yiv6018586641 div.yiv6018586641msochpdefault1 {margin-right:0in;margin-left:0in;font-size:12.0pt;}#yiv6018586641 p.yiv6018586641msonormal4, #yiv6018586641 li.yiv6018586641msonormal4, #yiv6018586641 div.yiv6018586641msonormal4 {margin-right:0in;margin-left:0in;font-size:12.0pt;}#yiv6018586641 p.yiv6018586641msoacetate2, #yiv6018586641 li.yiv6018586641msoacetate2, #yiv6018586641 div.yiv6018586641msoacetate2 {margin-right:0in;margin-left:0in;font-size:12.0pt;}#yiv6018586641 p.yiv6018586641msonormal5, #yiv6018586641 li.yiv6018586641msonormal5, #yiv6018586641 div.yiv6018586641msonormal5 {margin-right:0in;margin-left:0in;font-size:12.0pt;}#yiv6018586641 p.yiv6018586641msonormal12, #yiv6018586641 li.yiv6018586641msonormal12, #yiv6018586641 div.yiv6018586641msonormal12 {margin-right:0in;margin-left:0in;font-size:12.0pt;}#yiv6018586641 p.yiv6018586641msochpdefault2, #yiv6018586641 li.yiv6018586641msochpdefault2, #yiv6018586641 div.yiv6018586641msochpdefault2 {margin-right:0in;margin-left:0in;font-size:12.0pt;}#yiv6018586641 p.yiv6018586641msonormal21, #yiv6018586641 li.yiv6018586641msonormal21, #yiv6018586641 div.yiv6018586641msonormal21 {margin-right:0in;margin-left:0in;font-size:12.0pt;}#yiv6018586641 p.yiv6018586641msoacetate11, #yiv6018586641 li.yiv6018586641msoacetate11, #yiv6018586641 div.yiv6018586641msoacetate11 {margin-right:0in;margin-left:0in;font-size:12.0pt;}#yiv6018586641 p.yiv6018586641msonormal31, #yiv6018586641 li.yiv6018586641msonormal31, #yiv6018586641 div.yiv6018586641msonormal31 {margin-right:0in;margin-left:0in;font-size:12.0pt;}#yiv6018586641 p.yiv6018586641msonormal111, #yiv6018586641 li.yiv6018586641msonormal111, #yiv6018586641 div.yiv6018586641msonormal111 {margin-right:0in;margin-left:0in;font-size:12.0pt;}#yiv6018586641 p.yiv6018586641msochpdefault11, #yiv6018586641 li.yiv6018586641msochpdefault11, #yiv6018586641 div.yiv6018586641msochpdefault11 {margin-right:0in;margin-left:0in;font-size:12.0pt;}#yiv6018586641 p.yiv6018586641msonormal6, #yiv6018586641 li.yiv6018586641msonormal6, #yiv6018586641 div.yiv6018586641msonormal6 {margin:0in;margin-bottom:.0001pt;font-size:12.0pt;}#yiv6018586641 p.yiv6018586641msoacetate3, #yiv6018586641 li.yiv6018586641msoacetate3, #yiv6018586641 div.yiv6018586641msoacetate3 {margin:0in;margin-bottom:.0001pt;font-size:12.0pt;}#yiv6018586641 p.yiv6018586641msonormal7, #yiv6018586641 li.yiv6018586641msonormal7, #yiv6018586641 div.yiv6018586641msonormal7 {margin-right:0in;margin-left:0in;font-size:12.0pt;}#yiv6018586641 p.yiv6018586641msonormal13, #yiv6018586641 li.yiv6018586641msonormal13, #yiv6018586641 div.yiv6018586641msonormal13 {margin-right:0in;margin-left:0in;font-size:12.0pt;}#yiv6018586641 p.yiv6018586641msochpdefault3, #yiv6018586641 li.yiv6018586641msochpdefault3, #yiv6018586641 div.yiv6018586641msochpdefault3 {margin-right:0in;margin-left:0in;font-size:12.0pt;}#yiv6018586641 p.yiv6018586641msonormal22, #yiv6018586641 li.yiv6018586641msonormal22, #yiv6018586641 div.yiv6018586641msonormal22 {margin-right:0in;margin-left:0in;font-size:12.0pt;}#yiv6018586641 p.yiv6018586641msoacetate12, #yiv6018586641 li.yiv6018586641msoacetate12, #yiv6018586641 div.yiv6018586641msoacetate12 {margin-right:0in;margin-left:0in;font-size:12.0pt;}#yiv6018586641 p.yiv6018586641msonormal32, #yiv6018586641 li.yiv6018586641msonormal32, #yiv6018586641 div.yiv6018586641msonormal32 {margin-right:0in;margin-left:0in;font-size:12.0pt;}#yiv6018586641 p.yiv6018586641msonormal112, #yiv6018586641 li.yiv6018586641msonormal112, #yiv6018586641 div.yiv6018586641msonormal112 {margin-right:0in;margin-left:0in;font-size:12.0pt;}#yiv6018586641 p.yiv6018586641msochpdefault12, #yiv6018586641 li.yiv6018586641msochpdefault12, #yiv6018586641 div.yiv6018586641msochpdefault12 {margin-right:0in;margin-left:0in;font-size:12.0pt;}#yiv6018586641 p.yiv6018586641msonormal41, #yiv6018586641 li.yiv6018586641msonormal41, #yiv6018586641 div.yiv6018586641msonormal41 {margin:0in;margin-bottom:.0001pt;font-size:12.0pt;}#yiv6018586641 p.yiv6018586641msoacetate21, #yiv6018586641 li.yiv6018586641msoacetate21, #yiv6018586641 div.yiv6018586641msoacetate21 {margin-right:0in;margin-left:0in;font-size:12.0pt;}#yiv6018586641 p.yiv6018586641msonormal51, #yiv6018586641 li.yiv6018586641msonormal51, #yiv6018586641 div.yiv6018586641msonormal51 {margin-right:0in;margin-left:0in;font-size:12.0pt;}#yiv6018586641 p.yiv6018586641msonormal121, #yiv6018586641 li.yiv6018586641msonormal121, #yiv6018586641 div.yiv6018586641msonormal121 {margin-right:0in;margin-left:0in;font-size:12.0pt;}#yiv6018586641 p.yiv6018586641msochpdefault21, #yiv6018586641 li.yiv6018586641msochpdefault21, #yiv6018586641 div.yiv6018586641msochpdefault21 {margin-right:0in;margin-left:0in;font-size:12.0pt;}#yiv6018586641 p.yiv6018586641msonormal211, #yiv6018586641 li.yiv6018586641msonormal211, #yiv6018586641 div.yiv6018586641msonormal211 {margin:0in;margin-bottom:.0001pt;font-size:12.0pt;}#yiv6018586641 p.yiv6018586641msoacetate111, #yiv6018586641 li.yiv6018586641msoacetate111, #yiv6018586641 div.yiv6018586641msoacetate111 {margin:0in;margin-bottom:.0001pt;font-size:8.0pt;}#yiv6018586641 p.yiv6018586641msonormal311, #yiv6018586641 li.yiv6018586641msonormal311, #yiv6018586641 div.yiv6018586641msonormal311 {margin-right:0in;margin-left:0in;font-size:12.0pt;}#yiv6018586641 p.yiv6018586641msonormal1111, #yiv6018586641 li.yiv6018586641msonormal1111, #yiv6018586641 div.yiv6018586641msonormal1111 {margin:0in;margin-bottom:.0001pt;font-size:11.0pt;}#yiv6018586641 p.yiv6018586641msochpdefault111, #yiv6018586641 li.yiv6018586641msochpdefault111, #yiv6018586641 div.yiv6018586641msochpdefault111 {margin-right:0in;margin-left:0in;font-size:10.0pt;}#yiv6018586641 span.yiv6018586641msohyperlink {}#yiv6018586641 span.yiv6018586641msohyperlinkfollowed {}#yiv6018586641 span.yiv6018586641balloontextchar {}#yiv6018586641 span.yiv6018586641msohyperlink1 {}#yiv6018586641 span.yiv6018586641msohyperlinkfollowed1 {}#yiv6018586641 span.yiv6018586641msohyperlink21 {}#yiv6018586641 span.yiv6018586641msohyperlinkfollowed21 {}#yiv6018586641 span.yiv6018586641msohyperlink111 {}#yiv6018586641 span.yiv6018586641msohyperlinkfollowed111 {}#yiv6018586641 span.yiv6018586641emailstyle17111 {}#yiv6018586641 span.yiv6018586641emailstyle2711 {}#yiv6018586641 span.yiv6018586641emailstyle381 {}#yiv6018586641 span.yiv6018586641emailstyle56 {}#yiv6018586641 span.yiv6018586641emailstyle57 {}#yiv6018586641 span.yiv6018586641msohyperlink2 {color:blue;text-decoration:underline;}#yiv6018586641 span.yiv6018586641msohyperlinkfollowed2 {color:purple;text-decoration:underline;}#yiv6018586641 span.yiv6018586641balloontextchar1 {}#yiv6018586641 span.yiv6018586641msohyperlink11 {color:blue;text-decoration:underline;}#yiv6018586641 span.yiv6018586641msohyperlinkfollowed11 {color:purple;text-decoration:underline;}#yiv6018586641 span.yiv6018586641msohyperlink211 {color:blue;text-decoration:underline;}#yiv6018586641 span.yiv6018586641msohyperlinkfollowed211 {color:purple;text-decoration:underline;}#yiv6018586641 span.yiv6018586641msohyperlink1111 {color:blue;text-decoration:underline;}#yiv6018586641 span.yiv6018586641msohyperlinkfollowed1111 {color:purple;text-decoration:underline;}#yiv6018586641 span.yiv6018586641emailstyle171111 {color:windowtext;}#yiv6018586641 span.yiv6018586641emailstyle27111 {color:#1F497D;}#yiv6018586641 span.yiv6018586641emailstyle3811 {color:#1F497D;}#yiv6018586641 span.yiv6018586641emailstyle561 {color:#1F497D;}#yiv6018586641 span.yiv6018586641emailstyle571 {color:#1F497D;}#yiv6018586641 span.yiv6018586641EmailStyle86 {color:#1F497D;}#yiv6018586641 .yiv6018586641MsoChpDefault {font-size:10.0pt;} _filtered #yiv6018586641 {margin:1.0in 1.0in 1.0in 1.0in;}#yiv6018586641 div.yiv6018586641WordSection1 {}#yiv6018586641 |
From: Parham, C. <cp...@bi...> - 2015-09-03 15:27:18
|
Oh happy days! File upload is working. Thanks for your help. From: Ahmed Ashour [mailto:asa...@ya...] Sent: Monday, August 24, 2015 1:01 PM To: htm...@li... Subject: Re: [Htmlunit-user] RichFaces 4 fileUpload Hi Clinton, Thanks for clarifying. Handling this has been just fixed in SVN. Please update if you still have an issue. Thanks, Ahmed ________________________________ From: "Parham, Clinton" <cp...@bi...<mailto:cp...@bi...>> To: Ahmed Ashour <asa...@ya...<mailto:asa...@ya...>>; "htm...@li...<mailto:htm...@li...>" <htm...@li...<mailto:htm...@li...>> Sent: Monday, August 24, 2015 4:31 PM Subject: Re: [Htmlunit-user] RichFaces 4 fileUpload Hi Ahmed, The reason your code isn’t producing a POST is because you are using an outdated element ID: ‘j_idt1245:upload’. This element ID changes whenever the website maintainers push new code out. So today, the ID is 'j_idt1269:upload'. I tried highlighting this in an earlier reply but maybe you missed it. Please try again while ensuring you’re using the current element ID. Thank you kindly, Clint ________________________________ The contents contained herein may contain confidential information. If you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution, printing or action taken on the contents is strictly prohibited. If you have received this email in error, please notify the sender immediately and delete this message. |
From: Parham, C. <cp...@bi...> - 2015-08-08 01:46:41
Attachments:
image001.png
image002.png
|
Hi Ahmed, Debugging the code, I have a call stack that is only two levels deep. I’ve taken browser screenshots of the code at fileupload.js#403 (where HTMLUnit says “e” is undefined) and another screenshot of the code calling fileupload from jquery.js#547. The jquery code passes “arguments” as the parameter to fileupload.js. So I’m assuming that “arguments” is for some reason undefined when running HTMLUnit test. Why, I don’t know. Can you suggest something? Thank you. [cid:image001.png@01D0D15A.671007B0] [cid:image002.png@01D0D15A.671007B0] From: Ahmed Ashour [mailto:asa...@ya...] Sent: Thursday, August 06, 2015 6:36 PM To: htm...@li... Subject: Re: [Htmlunit-user] RichFaces 4 fileUpload Hi, You can use "alert(arguments.callee.caller);" Please read some hints in http://htmlunit.sourceforge.net/submittingJSBugs.html#JavaScript_hints Ahmed ________________________________ From: "Parham, Clinton" <cp...@bi...<mailto:cp...@bi...>> To: "htm...@li...<mailto:htm...@li...>" <htm...@li...<mailto:htm...@li...>> Sent: Thursday, August 6, 2015 10:41 PM Subject: [Htmlunit-user] RichFaces 4 fileUpload [Boxbe]<https://www.boxbe.com/overview>[http://www.boxbe.com/stfopen?tc_serial=22212599162&tc_rand=861515138&utm_source=stf&utm_medium=email&utm_campaign=ANNO_CLEANUP_ADD&utm_content=001]This message is eligible for Automatic Cleanup! (cp...@bi...<mailto:cp...@bi...>) Add cleanup rule<https://www.boxbe.com/popup?url=https%3A%2F%2Fwww.boxbe.com%2Fcleanup%3Ftoken%3DIi8%252Bnk7qFall%252FMp1olc8mcL75eB22CTSOdEWLX%252F%252FOUWTlbWYsL0PJc7Riu6FXd37Sgx4PpTi8UqREKNrbwunkj6KPoZym5Nl14m%252BETSxLFUc%252BfKFMFPbKHMTQb8Viuqrs2Zl1nL2D8mSI20ANfPxtw%253D%253D%26key%3DV8qrOxzB48Po5biHytbO8smpjSAQyzonFfA97xlaZs8%253D&tc_serial=22212599162&tc_rand=861515138&utm_source=stf&utm_medium=email&utm_campaign=ANNO_CLEANUP_ADD&utm_content=001> | More info<http://blog.boxbe.com/general/boxbe-automatic-cleanup?tc_serial=22212599162&tc_rand=861515138&utm_source=stf&utm_medium=email&utm_campaign=ANNO_CLEANUP_ADD&utm_content=001> Hello, I continue to struggle to get the RichFaces fileUpload component to work with HTMLUnit 2.18. (http://showcase.richfaces.org/richfaces/component-sample.jsf?demo=fileUpload&skin=blueSky) After setting the file to upload with htmlInput.setValueAttribute and clicking the Upload button, I get this error from HTMLUnit: 2015-08-06 15:23:58,744 INFO main [com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine][handleJavaScriptException] Caught script exception ======= EXCEPTION START ======== EcmaError: lineNumber=[403] column=[0] lineSource=[null] name=[TypeError] sourceName=[https://bio206/saas/org.richfaces.resources/javax.faces.resource/org.richfaces/fileupload.js] message=[TypeError: Cannot read property "target" from undefined (https://bio206/saas/org.richfaces.resources/javax.faces.resource/org.richfaces/fileupload.js#403)] com.gargoylesoftware.htmlunit.ScriptException: TypeError: Cannot read property "target" from undefined (https://bio206/saas/org.richfaces.resources/javax.faces.resource/org.richfaces/fileupload.js#403) at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$HtmlUnitContextAction.run(JavaScriptEngine.java:865) at net.sourceforge.htmlunit.corejs.javascript.Context.call(Context.java:628) … == CALLING JAVASCRIPT == function () { return fn.apply(context || this, args.concat(slice.call(arguments))); } ======= EXCEPTION END ======== I’ve tried debugging and all that I can tell is that “e” is undefined on this line #403 in fileupload.js: switch (e.target.status) { The function in fileupload.js is called from jquery.js but I cannot trace the argument to better understand why it’s undefined when HTMLUnit is running. I’ve attached a testcase. Any suggestions? Thanks, Clint ________________________________ The contents contained herein may contain confidential information. If you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution, printing or action taken on the contents is strictly prohibited. If you have received this email in error, please notify the sender immediately and delete this message. ------------------------------------------------------------------------------ _______________________________________________ Htmlunit-user mailing list Htm...@li...<mailto:Htm...@li...> https://lists.sourceforge.net/lists/listinfo/htmlunit-user ________________________________ The contents contained herein may contain confidential information. If you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution, printing or action taken on the contents is strictly prohibited. If you have received this email in error, please notify the sender immediately and delete this message. |