From: Casey C. <cra...@na...> - 2005-04-27 23:36:28
|
I have a page where I'm moving elements from one widget to another via javascript: (Pardon the ascii art) [Select-Many] [Button -> ] [ Select-Many Results | | | [Select-Many] [Button -> ] | (across all items on left)| | | [TextField] [Button -> ] | ] [Button: OK] The select-many's are prefilled with possible results, the text field lets you manually add results. Each of the buttons labelled -> moves the item from the respective field over to the Results select; this is done using javascript. What I'm trying to do using htmlunit is fill in the text field; click the corresponding button to add it to the results, then click OK. This doesn't work for me (no error, just no change is made when I run the test). I've tried using the following: mainform.submit("name-of-button"); (both catching the return and using it and ignoring the return value) and (ClickableElement) getHtmlElementById("id-of-button") .click() (both catching the return and using it; as well as ignoreing the return value). Is there some way to get javascript mutation of a HtmlPage/HtmlForm to work? To add further complication; the -> buttons are disabled until there is an entry selected in the appropriate select-many or there is text in the text-field. -- Casey |
From: Marc G. <mgu...@ya...> - 2005-04-28 10:01:16
|
Hi Casey, this seems that htmlunit should be able to do what you want. Which version do you use? Can you turn the js log level to debug to get more information? Marc. Casey Crabb wrote: > I have a page where I'm moving elements from one widget to another via > javascript: > > (Pardon the ascii art) > > [Select-Many] [Button -> ] [ Select-Many Results | > | | > [Select-Many] [Button -> ] | (across all items on left)| > | | > [TextField] [Button -> ] | ] > > [Button: OK] > > > The select-many's are prefilled with possible results, the text field > lets you manually add results. > > Each of the buttons labelled -> moves the item from the respective > field over to the Results select; this is done using javascript. > > What I'm trying to do using htmlunit is fill in the text field; click > the corresponding button to add it to the results, then click OK. > > This doesn't work for me (no error, just no change is made when I run > the test). > > > I've tried using the following: mainform.submit("name-of-button"); > (both catching the return and using it and ignoring the return value) > > and > > (ClickableElement) getHtmlElementById("id-of-button") .click() (both > catching the return and using it; as well as ignoreing the return > value). > > > Is there some way to get javascript mutation of a HtmlPage/HtmlForm to work? > > To add further complication; the -> buttons are disabled until there > is an entry selected in the appropriate select-many or there is text > in the text-field. > > -- > Casey > > > ------------------------------------------------------- > SF.Net email is sponsored by: Tell us your software development plans! > Take this survey and enter to win a one-year sub to SourceForge.net > Plus IDC's 2005 look-ahead and a copy of this survey > Click here to start! http://www.idcswdc.com/cgi-bin/survey?id=105hix > _______________________________________________ > Htmlunit-user mailing list > Htm...@li... > https://lists.sourceforge.net/lists/listinfo/htmlunit-user > |
From: Casey C. <cra...@na...> - 2005-04-28 20:19:09
|
I'm using htmlunit-1.5 (the binaries) that I downloaded from sourceforge about a month ago. When javascript is modifying the page (or the form in my case) as a result of clicking a button in a form (that doesn't actually submit the form, the javascript method called returns false) where should those changes show up? In the existing HtmlPage/HtmlForm, or should I capture to the return value of the click() call? -- Casey On Thu, Apr 28, 2005 at 12:03:05PM +0200, Marc Guillemot wrote: > Hi Casey, > > this seems that htmlunit should be able to do what you want. Which version > do you use? Can you turn the js log level to debug to get more information? > > Marc. > > Casey Crabb wrote: > >I have a page where I'm moving elements from one widget to another via > >javascript: > > > >(Pardon the ascii art) > > > >[Select-Many] [Button -> ] [ Select-Many Results | > > | | > >[Select-Many] [Button -> ] | (across all items on left)| > > | | > >[TextField] [Button -> ] | ] > > > >[Button: OK] > > > > > >The select-many's are prefilled with possible results, the text field > >lets you manually add results. > > > >Each of the buttons labelled -> moves the item from the respective > >field over to the Results select; this is done using javascript. > > > >What I'm trying to do using htmlunit is fill in the text field; click > >the corresponding button to add it to the results, then click OK. > > > >This doesn't work for me (no error, just no change is made when I run > >the test). > > > > > >I've tried using the following: mainform.submit("name-of-button"); > >(both catching the return and using it and ignoring the return value) > > > >and > > > >(ClickableElement) getHtmlElementById("id-of-button") .click() (both > >catching the return and using it; as well as ignoreing the return > >value). > > > > > >Is there some way to get javascript mutation of a HtmlPage/HtmlForm to > >work? > > > >To add further complication; the -> buttons are disabled until there > >is an entry selected in the appropriate select-many or there is text > >in the text-field. > > > >-- > >Casey > > > > > >------------------------------------------------------- > >SF.Net email is sponsored by: Tell us your software development plans! > >Take this survey and enter to win a one-year sub to SourceForge.net > >Plus IDC's 2005 look-ahead and a copy of this survey > >Click here to start! http://www.idcswdc.com/cgi-bin/survey?id=105hix > >_______________________________________________ > >Htmlunit-user mailing list > >Htm...@li... > >https://lists.sourceforge.net/lists/listinfo/htmlunit-user > > > > > > ------------------------------------------------------- > SF.Net email is sponsored by: Tell us your software development plans! > Take this survey and enter to win a one-year sub to SourceForge.net > Plus IDC's 2005 look-ahead and a copy of this survey > Click here to start! http://www.idcswdc.com/cgi-bin/survey?id=105hix > _______________________________________________ > Htmlunit-user mailing list > Htm...@li... > https://lists.sourceforge.net/lists/listinfo/htmlunit-user |
From: Marc G. <mgu...@ya...> - 2005-04-29 08:16:18
|
changes should be in the HtmlPage you're working on. Marc. Casey Crabb wrote: > I'm using htmlunit-1.5 (the binaries) that I downloaded from > sourceforge about a month ago. > > When javascript is modifying the page (or the form in my case) as a > result of clicking a button in a form (that doesn't actually submit > the form, the javascript method called returns false) where should > those changes show up? In the existing HtmlPage/HtmlForm, or should I > capture to the return value of the click() call? > > -- > Casey > > On Thu, Apr 28, 2005 at 12:03:05PM +0200, Marc Guillemot wrote: > >>Hi Casey, >> >>this seems that htmlunit should be able to do what you want. Which version >>do you use? Can you turn the js log level to debug to get more information? >> >>Marc. >> >>Casey Crabb wrote: >> >>>I have a page where I'm moving elements from one widget to another via >>>javascript: >>> >>>(Pardon the ascii art) >>> >>>[Select-Many] [Button -> ] [ Select-Many Results | >>> | | >>>[Select-Many] [Button -> ] | (across all items on left)| >>> | | >>>[TextField] [Button -> ] | ] >>> >>>[Button: OK] >>> >>> >>>The select-many's are prefilled with possible results, the text field >>>lets you manually add results. >>> >>>Each of the buttons labelled -> moves the item from the respective >>>field over to the Results select; this is done using javascript. >>> >>>What I'm trying to do using htmlunit is fill in the text field; click >>>the corresponding button to add it to the results, then click OK. >>> >>>This doesn't work for me (no error, just no change is made when I run >>>the test). >>> >>> >>>I've tried using the following: mainform.submit("name-of-button"); >>>(both catching the return and using it and ignoring the return value) >>> >>>and >>> >>>(ClickableElement) getHtmlElementById("id-of-button") .click() (both >>>catching the return and using it; as well as ignoreing the return >>>value). >>> >>> >>>Is there some way to get javascript mutation of a HtmlPage/HtmlForm to >>>work? >>> >>>To add further complication; the -> buttons are disabled until there >>>is an entry selected in the appropriate select-many or there is text >>>in the text-field. >>> >>>-- >>>Casey >>> >>> >>>------------------------------------------------------- >>>SF.Net email is sponsored by: Tell us your software development plans! >>>Take this survey and enter to win a one-year sub to SourceForge.net >>>Plus IDC's 2005 look-ahead and a copy of this survey >>>Click here to start! http://www.idcswdc.com/cgi-bin/survey?id=105hix >>>_______________________________________________ >>>Htmlunit-user mailing list >>>Htm...@li... >>>https://lists.sourceforge.net/lists/listinfo/htmlunit-user >>> >> >> >> >>------------------------------------------------------- >>SF.Net email is sponsored by: Tell us your software development plans! >>Take this survey and enter to win a one-year sub to SourceForge.net >>Plus IDC's 2005 look-ahead and a copy of this survey >>Click here to start! http://www.idcswdc.com/cgi-bin/survey?id=105hix >>_______________________________________________ >>Htmlunit-user mailing list >>Htm...@li... >>https://lists.sourceforge.net/lists/listinfo/htmlunit-user > > > > ------------------------------------------------------- > SF.Net email is sponsored by: Tell us your software development plans! > Take this survey and enter to win a one-year sub to SourceForge.net > Plus IDC's 2005 look-ahead and a copy of this survey > Click here to start! http://www.idcswdc.com/cgi-bin/survey?id=105hix > _______________________________________________ > Htmlunit-user mailing list > Htm...@li... > https://lists.sourceforge.net/lists/listinfo/htmlunit-user > |
From: Casey C. <cra...@na...> - 2005-04-29 14:31:37
|
I think I found the problem; those buttons are disabled by default, and only enabled when focus is placed on the multiselect or textarea associated with the button. TextArea.setText() doesn't seem to focus the TextArea; neither does TextArea.click(). Is there a reason that neither of these methods focus the TextArea? -- Casey On Fri, Apr 29, 2005 at 10:18:05AM +0200, Marc Guillemot wrote: > changes should be in the HtmlPage you're working on. > > Marc. > > Casey Crabb wrote: > >I'm using htmlunit-1.5 (the binaries) that I downloaded from > >sourceforge about a month ago. > > > >When javascript is modifying the page (or the form in my case) as a > >result of clicking a button in a form (that doesn't actually submit > >the form, the javascript method called returns false) where should > >those changes show up? In the existing HtmlPage/HtmlForm, or should I > >capture to the return value of the click() call? > > > >-- > >Casey > > > >On Thu, Apr 28, 2005 at 12:03:05PM +0200, Marc Guillemot wrote: > > > >>Hi Casey, > >> > >>this seems that htmlunit should be able to do what you want. Which > >>version do you use? Can you turn the js log level to debug to get more > >>information? > >> > >>Marc. > >> > >>Casey Crabb wrote: > >> > >>>I have a page where I'm moving elements from one widget to another via > >>>javascript: > >>> > >>>(Pardon the ascii art) > >>> > >>>[Select-Many] [Button -> ] [ Select-Many Results | > >>> | | > >>>[Select-Many] [Button -> ] | (across all items on left)| > >>> | | > >>>[TextField] [Button -> ] | ] > >>> > >>>[Button: OK] > >>> > >>> > >>>The select-many's are prefilled with possible results, the text field > >>>lets you manually add results. > >>> > >>>Each of the buttons labelled -> moves the item from the respective > >>>field over to the Results select; this is done using javascript. > >>> > >>>What I'm trying to do using htmlunit is fill in the text field; click > >>>the corresponding button to add it to the results, then click OK. > >>> > >>>This doesn't work for me (no error, just no change is made when I run > >>>the test). > >>> > >>> > >>>I've tried using the following: mainform.submit("name-of-button"); > >>>(both catching the return and using it and ignoring the return value) > >>> > >>>and > >>> > >>>(ClickableElement) getHtmlElementById("id-of-button") .click() (both > >>>catching the return and using it; as well as ignoreing the return > >>>value). > >>> > >>> > >>>Is there some way to get javascript mutation of a HtmlPage/HtmlForm to > >>>work? > >>> > >>>To add further complication; the -> buttons are disabled until there > >>>is an entry selected in the appropriate select-many or there is text > >>>in the text-field. > >>> > >>>-- > >>>Casey > >>> > >>> > >>>------------------------------------------------------- > >>>SF.Net email is sponsored by: Tell us your software development plans! > >>>Take this survey and enter to win a one-year sub to SourceForge.net > >>>Plus IDC's 2005 look-ahead and a copy of this survey > >>>Click here to start! http://www.idcswdc.com/cgi-bin/survey?id=105hix > >>>_______________________________________________ > >>>Htmlunit-user mailing list > >>>Htm...@li... > >>>https://lists.sourceforge.net/lists/listinfo/htmlunit-user > >>> > >> > >> > >> > >>------------------------------------------------------- > >>SF.Net email is sponsored by: Tell us your software development plans! > >>Take this survey and enter to win a one-year sub to SourceForge.net > >>Plus IDC's 2005 look-ahead and a copy of this survey > >>Click here to start! http://www.idcswdc.com/cgi-bin/survey?id=105hix > >>_______________________________________________ > >>Htmlunit-user mailing list > >>Htm...@li... > >>https://lists.sourceforge.net/lists/listinfo/htmlunit-user > > > > > > > >------------------------------------------------------- > >SF.Net email is sponsored by: Tell us your software development plans! > >Take this survey and enter to win a one-year sub to SourceForge.net > >Plus IDC's 2005 look-ahead and a copy of this survey > >Click here to start! http://www.idcswdc.com/cgi-bin/survey?id=105hix > >_______________________________________________ > >Htmlunit-user mailing list > >Htm...@li... > >https://lists.sourceforge.net/lists/listinfo/htmlunit-user > > > > > > ------------------------------------------------------- > SF.Net email is sponsored by: Tell us your software development plans! > Take this survey and enter to win a one-year sub to SourceForge.net > Plus IDC's 2005 look-ahead and a copy of this survey > Click here to start! http://www.idcswdc.com/cgi-bin/survey?id=105hix > _______________________________________________ > Htmlunit-user mailing list > Htm...@li... > https://lists.sourceforge.net/lists/listinfo/htmlunit-user |