From: Parham, C. <cp...@bi...> - 2015-07-09 15:41:55
|
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 ________________________________ 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. |