From: Ahmed A. <asa...@ya...> - 2015-07-10 13:29:21
|
Hi Clinton, FormData is not implemented, stay tuned. Ahmed From: "Parham, Clinton" <cp...@bi...> To: Ahmed Ashour <asa...@ya...>; "htm...@li..." <htm...@li...> Sent: Thursday, July 9, 2015 5:41 PM Subject: Re: [Htmlunit-user] RichFaces fileUpload: Cannot call method "match" of undefined #yiv6805653247 #yiv6805653247 -- _filtered #yiv6805653247 {font-family:Calibri;panose-1:2 15 5 2 2 2 4 3 2 4;}#yiv6805653247 #yiv6805653247 p.yiv6805653247MsoNormal, #yiv6805653247 li.yiv6805653247MsoNormal, #yiv6805653247 div.yiv6805653247MsoNormal {margin:0in;margin-bottom:.0001pt;font-size:12.0pt;}#yiv6805653247 a:link, #yiv6805653247 span.yiv6805653247MsoHyperlink {color:blue;text-decoration:underline;}#yiv6805653247 a:visited, #yiv6805653247 span.yiv6805653247MsoHyperlinkFollowed {color:purple;text-decoration:underline;}#yiv6805653247 p.yiv6805653247msonormal, #yiv6805653247 li.yiv6805653247msonormal, #yiv6805653247 div.yiv6805653247msonormal {margin-right:0in;margin-left:0in;font-size:12.0pt;}#yiv6805653247 span.yiv6805653247msohyperlink {}#yiv6805653247 span.yiv6805653247msohyperlinkfollowed {}#yiv6805653247 span.yiv6805653247emailstyle17 {}#yiv6805653247 p.yiv6805653247msonormal1, #yiv6805653247 li.yiv6805653247msonormal1, #yiv6805653247 div.yiv6805653247msonormal1 {margin:0in;margin-bottom:.0001pt;font-size:11.0pt;}#yiv6805653247 span.yiv6805653247msohyperlink1 {color:blue;text-decoration:underline;}#yiv6805653247 span.yiv6805653247msohyperlinkfollowed1 {color:purple;text-decoration:underline;}#yiv6805653247 span.yiv6805653247emailstyle171 {color:windowtext;}#yiv6805653247 span.yiv6805653247EmailStyle25 {color:#1F497D;}#yiv6805653247 .yiv6805653247MsoChpDefault {font-size:10.0pt;} _filtered #yiv6805653247 {margin:1.0in 1.0in 1.0in 1.0in;}#yiv6805653247 div.yiv6805653247WordSection1 {}#yiv6805653247 Hi Ahmed, When setting to Chrome that particular error is solved. This successfully sets the file to be uploaded into the file input component. The next step is to fire the upload by clicking the “Upload” button, which fails: ScriptException: TypeError: Cannot find function append in object [object FormData] Here’s my test method: public class HTMLUnitTestCase { final WebClient webClient = new WebClient(BrowserVersion.CHROME); @Test public void testRichFacesFileUpload() throws Exception { final HtmlPage page = webClient .getPage("http://showcase.richfaces.org/richfaces/component-sample.jsf?demo=fileUpload&skin=blueSky"); // choose file to upload HtmlInput htmlInput = (HtmlInput) page.getByXPath( "//input[@type='file']").get(0); htmlInput .setValueAttribute("/tmp/KYN_TopLeft.PNG"); // click Upload button HtmlElement element = (HtmlElement) page.getByXPath( "//*[@id='j_idt1904:upload']/div[1]/span[1]/span[2]/span").get( 0); element.click(); } } Am I doing this right? Thank you, Clint |