From: Parham, C. <cp...@bi...> - 2015-07-03 13:40:05
|
Hello HTMLUnit users, I've been using HTMLUnit for a while with the RichFaces fileUpload component. But after a recent RichFaces update (from 4.3.7 to 4.5.7), my test no longer works: TypeError: Cannot call method "match" of undefined I've tried updating to HTMLUnit 2.17 and still get the error. A testcase to reproduce is included below. How can I get this working again? Thanks, Clint package myTests; import org.junit.Test; import com.gargoylesoftware.htmlunit.WebClient; import com.gargoylesoftware.htmlunit.html.HtmlInput; import com.gargoylesoftware.htmlunit.html.HtmlPage; public class HTMLUnitTestCase { final WebClient webClient = new WebClient(); @Test public void testRichFacesFileUpload() throws Exception { final HtmlPage page = webClient .getPage("http://showcase.richfaces.org/richfaces/component-sample.jsf?demo=fileUpload&skin=blueSky"); HtmlInput htmlInput = (HtmlInput) page.getByXPath( "//input[@type='file']").get(0); htmlInput.setValueAttribute("/tmp/KYN_TopLeft.PNG"); } } ________________________________ 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-07-05 06:26:52
|
Hi, I tried with BrowserVersion.CHROME, since I don't have IE8. input.files was not implemented, now it is fixed in SVN. Once we have new successful build, you can use it. Please note it is supported in only BrowserVersion.CHROME/FF/IE11 If you still need IE8, then please trace down the single JavaScript line which returned null (but not in real IE8). You can use proxy (e.g. Charles) to change the incoming JavaScript and compare the results between HtmlUnit and real IE8. Ahmed From: "Parham, Clinton" <cp...@bi...> To: "htm...@li..." <htm...@li...> Sent: Friday, July 3, 2015 3:24 PM Subject: [Htmlunit-user] RichFaces fileUpload: Cannot call method "match" of undefined <!--#yiv9648094149 _filtered #yiv9648094149 {font-family:Calibri;panose-1:2 15 5 2 2 2 4 3 2 4;}#yiv9648094149 #yiv9648094149 p.yiv9648094149MsoNormal, #yiv9648094149 li.yiv9648094149MsoNormal, #yiv9648094149 div.yiv9648094149MsoNormal {margin:0in;margin-bottom:.0001pt;font-size:11.0pt;font-family:"Calibri", "sans-serif";}#yiv9648094149 a:link, #yiv9648094149 span.yiv9648094149MsoHyperlink {color:blue;text-decoration:underline;}#yiv9648094149 a:visited, #yiv9648094149 span.yiv9648094149MsoHyperlinkFollowed {color:purple;text-decoration:underline;}#yiv9648094149 span.yiv9648094149EmailStyle17 {font-family:"Calibri", "sans-serif";color:windowtext;}#yiv9648094149 .yiv9648094149MsoChpDefault {font-family:"Calibri", "sans-serif";} _filtered #yiv9648094149 {margin:1.0in 1.0in 1.0in 1.0in;}#yiv9648094149 div.yiv9648094149WordSection1 {}-->Hello HTMLUnit users, I’ve been using HTMLUnit for a while with the RichFaces fileUpload component. But after a recent RichFaces update (from 4.3.7 to 4.5.7), my test no longer works: TypeError: Cannot call method "match" of undefined I’ve tried updating to HTMLUnit 2.17 and still get the error. A testcase to reproduce is included below. How can I get this working again? Thanks, Clint package myTests; import org.junit.Test; import com.gargoylesoftware.htmlunit.WebClient; import com.gargoylesoftware.htmlunit.html.HtmlInput; import com.gargoylesoftware.htmlunit.html.HtmlPage; public class HTMLUnitTestCase { final WebClient webClient = new WebClient(); @Test public void testRichFacesFileUpload() throws Exception { final HtmlPage page = webClient .getPage("http://showcase.richfaces.org/richfaces/component-sample.jsf?demo=fileUpload&skin=blueSky"); HtmlInput htmlInput = (HtmlInput) page.getByXPath( "//input[@type='file']").get(0); htmlInput.setValueAttribute("/tmp/KYN_TopLeft.PNG"); } } | 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. | ------------------------------------------------------------------------------ Don't Limit Your Business. Reach for the Cloud. GigeNET's Cloud Solutions provide you with the tools and support that you need to offload your IT needs and focus on growing your business. Configured For All Businesses. Start Your Cloud Today. https://www.gigenetcloud.com/ _______________________________________________ Htmlunit-user mailing list Htm...@li... https://lists.sourceforge.net/lists/listinfo/htmlunit-user |
From: Ahmed A. <asa...@ya...> - 2015-07-08 21:54:45
|
Hi, Have you tried with new WebClient(BrowserVersion.CHROME)? It works for me. Please carefully read below. Ahmed From: Ahmed Ashour <asa...@ya...> To: "htm...@li..." <htm...@li...> Sent: Sunday, July 5, 2015 8:23 AM Subject: Re: [Htmlunit-user] RichFaces fileUpload: Cannot call method "match" of undefined Hi, I tried with BrowserVersion.CHROME, since I don't have IE8. input.files was not implemented, now it is fixed in SVN. Once we have new successful build, you can use it. Please note it is supported in only BrowserVersion.CHROME/FF/IE11 If you still need IE8, then please trace down the single JavaScript line which returned null (but not in real IE8). You can use proxy (e.g. Charles) to change the incoming JavaScript and compare the results between HtmlUnit and real IE8. Ahmed From: "Parham, Clinton" <cp...@bi...> To: "htm...@li..." <htm...@li...> Sent: Friday, July 3, 2015 3:24 PM Subject: [Htmlunit-user] RichFaces fileUpload: Cannot call method "match" of undefined #yiv0266802668 #yiv0266802668 -- filtered {font-family:Calibri;panose-1:2 15 5 2 2 2 4 3 2 4;}#yiv0266802668 p.yiv0266802668MsoNormal, #yiv0266802668 li.yiv0266802668MsoNormal, #yiv0266802668 div.yiv0266802668MsoNormal {margin:0in;margin-bottom:.0001pt;font-size:11.0pt;}#yiv0266802668 a:link, #yiv0266802668 span.yiv0266802668MsoHyperlink {color:blue;text-decoration:underline;}#yiv0266802668 a:visited, #yiv0266802668 span.yiv0266802668MsoHyperlinkFollowed {color:purple;text-decoration:underline;}#yiv0266802668 span.yiv0266802668EmailStyle17 {color:windowtext;}#yiv0266802668 .yiv0266802668MsoChpDefault {}#yiv0266802668 filtered {margin:1.0in 1.0in 1.0in 1.0in;}#yiv0266802668 div.yiv0266802668WordSection1 {}#yiv0266802668 Hello HTMLUnit users, I’ve been using HTMLUnit for a while with the RichFaces fileUpload component. But after a recent RichFaces update (from 4.3.7 to 4.5.7), my test no longer works: TypeError: Cannot call method "match" of undefined I’ve tried updating to HTMLUnit 2.17 and still get the error. A testcase to reproduce is included below. How can I get this working again? Thanks, Clint package myTests; import org.junit.Test; import com.gargoylesoftware.htmlunit.WebClient; import com.gargoylesoftware.htmlunit.html.HtmlInput; import com.gargoylesoftware.htmlunit.html.HtmlPage; public class HTMLUnitTestCase { final WebClient webClient = new WebClient(); @Test public void testRichFacesFileUpload() throws Exception { final HtmlPage page = webClient .getPage("http://showcase.richfaces.org/richfaces/component-sample.jsf?demo=fileUpload&skin=blueSky"); HtmlInput htmlInput = (HtmlInput) page.getByXPath( "//input[@type='file']").get(0); htmlInput.setValueAttribute("/tmp/KYN_TopLeft.PNG"); } } | 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. | ------------------------------------------------------------------------------ Don't Limit Your Business. Reach for the Cloud. GigeNET's Cloud Solutions provide you with the tools and support that you need to offload your IT needs and focus on growing your business. Configured For All Businesses. Start Your Cloud Today. https://www.gigenetcloud.com/ _______________________________________________ Htmlunit-user mailing list Htm...@li... https://lists.sourceforge.net/lists/listinfo/htmlunit-user |
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. |
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 |
From: Parham, C. <cp...@bi...> - 2015-07-10 19:24:06
|
Thank you for the reply… I’m looking forward to hearing more. From: Ahmed Ashour [mailto:asa...@ya...] Sent: Friday, July 10, 2015 9:26 AM To: htm...@li... Subject: Re: [Htmlunit-user] RichFaces fileUpload: Cannot call method "match" of undefined Hi Clinton, FormData is not implemented, stay tuned. 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: Thursday, July 9, 2015 5:41 PM Subject: Re: [Htmlunit-user] RichFaces fileUpload: Cannot call method "match" of undefined 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. |
From: Ahmed A. <asa...@ya...> - 2015-07-10 21:03:04
|
Hi again, Your last case works now. If you have more issues, please read https://sourceforge.net/p/htmlunit/code/HEAD/tree/trunk/htmlunit/src/site/xdoc/submittingJSBugs.xml Ahmed From: "Parham, Clinton" <cp...@bi...> To: Ahmed Ashour <asa...@ya...>; "htm...@li..." <htm...@li...> Sent: Friday, July 10, 2015 9:08 PM Subject: Re: [Htmlunit-user] RichFaces fileUpload: Cannot call method "match" of undefined #yiv4239493039 #yiv4239493039 -- _filtered #yiv4239493039 {font-family:Calibri;panose-1:2 15 5 2 2 2 4 3 2 4;} _filtered #yiv4239493039 {font-family:Tahoma;panose-1:2 11 6 4 3 5 4 4 2 4;} _filtered #yiv4239493039 {font-family:HelveticaNeue;}#yiv4239493039 #yiv4239493039 p.yiv4239493039MsoNormal, #yiv4239493039 li.yiv4239493039MsoNormal, #yiv4239493039 div.yiv4239493039MsoNormal {margin:0in;margin-bottom:.0001pt;font-size:12.0pt;}#yiv4239493039 a:link, #yiv4239493039 span.yiv4239493039MsoHyperlink {color:blue;text-decoration:underline;}#yiv4239493039 a:visited, #yiv4239493039 span.yiv4239493039MsoHyperlinkFollowed {color:purple;text-decoration:underline;}#yiv4239493039 p.yiv4239493039MsoAcetate, #yiv4239493039 li.yiv4239493039MsoAcetate, #yiv4239493039 div.yiv4239493039MsoAcetate {margin:0in;margin-bottom:.0001pt;font-size:8.0pt;}#yiv4239493039 p.yiv4239493039msonormal, #yiv4239493039 li.yiv4239493039msonormal, #yiv4239493039 div.yiv4239493039msonormal {margin-right:0in;margin-left:0in;font-size:12.0pt;}#yiv4239493039 p.yiv4239493039msonormal1, #yiv4239493039 li.yiv4239493039msonormal1, #yiv4239493039 div.yiv4239493039msonormal1 {margin-right:0in;margin-left:0in;font-size:12.0pt;}#yiv4239493039 p.yiv4239493039msochpdefault, #yiv4239493039 li.yiv4239493039msochpdefault, #yiv4239493039 div.yiv4239493039msochpdefault {margin-right:0in;margin-left:0in;font-size:12.0pt;}#yiv4239493039 span.yiv4239493039msohyperlink {}#yiv4239493039 span.yiv4239493039msohyperlinkfollowed {}#yiv4239493039 span.yiv4239493039msohyperlink1 {}#yiv4239493039 span.yiv4239493039msohyperlinkfollowed1 {}#yiv4239493039 span.yiv4239493039emailstyle171 {}#yiv4239493039 span.yiv4239493039emailstyle25 {}#yiv4239493039 p.yiv4239493039msonormal2, #yiv4239493039 li.yiv4239493039msonormal2, #yiv4239493039 div.yiv4239493039msonormal2 {margin:0in;margin-bottom:.0001pt;font-size:12.0pt;}#yiv4239493039 span.yiv4239493039msohyperlink2 {color:blue;text-decoration:underline;}#yiv4239493039 span.yiv4239493039msohyperlinkfollowed2 {color:purple;text-decoration:underline;}#yiv4239493039 p.yiv4239493039msonormal3, #yiv4239493039 li.yiv4239493039msonormal3, #yiv4239493039 div.yiv4239493039msonormal3 {margin-right:0in;margin-left:0in;font-size:12.0pt;}#yiv4239493039 p.yiv4239493039msonormal11, #yiv4239493039 li.yiv4239493039msonormal11, #yiv4239493039 div.yiv4239493039msonormal11 {margin:0in;margin-bottom:.0001pt;font-size:11.0pt;}#yiv4239493039 span.yiv4239493039msohyperlink11 {color:blue;text-decoration:underline;}#yiv4239493039 span.yiv4239493039msohyperlinkfollowed11 {color:purple;text-decoration:underline;}#yiv4239493039 span.yiv4239493039emailstyle1711 {color:windowtext;}#yiv4239493039 span.yiv4239493039emailstyle251 {color:#1F497D;}#yiv4239493039 p.yiv4239493039msochpdefault1, #yiv4239493039 li.yiv4239493039msochpdefault1, #yiv4239493039 div.yiv4239493039msochpdefault1 {margin-right:0in;margin-left:0in;font-size:10.0pt;}#yiv4239493039 span.yiv4239493039BalloonTextChar {}#yiv4239493039 span.yiv4239493039EmailStyle38 {color:#1F497D;}#yiv4239493039 .yiv4239493039MsoChpDefault {font-size:10.0pt;} _filtered #yiv4239493039 {margin:1.0in 1.0in 1.0in 1.0in;}#yiv4239493039 div.yiv4239493039WordSection1 {}#yiv4239493039 Thank you for the reply… I’m looking forward to hearing more. |
From: Parham, C. <cp...@bi...> - 2015-07-13 18:45:36
|
Confirmed it is working for me too. Thank you. From: Ahmed Ashour [mailto:asa...@ya...] Sent: Friday, July 10, 2015 5:00 PM To: htm...@li... Subject: Re: [Htmlunit-user] RichFaces fileUpload: Cannot call method "match" of undefined Hi again, Your last case works now. If you have more issues, please read https://sourceforge.net/p/htmlunit/code/HEAD/tree/trunk/htmlunit/src/site/xdoc/submittingJSBugs.xml 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: Friday, July 10, 2015 9:08 PM Subject: Re: [Htmlunit-user] RichFaces fileUpload: Cannot call method "match" of undefined Thank you for the reply… I’m looking forward to hearing more. ________________________________ 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. |