Bugs item #969653, was opened at 2004-06-09 16:46
Message generated for change (Comment added) made by henryju
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=497982&aid=969653&group_id=61302

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
>Category: HttpUnit plugin
Group: Release 1.3
>Status: Closed
Resolution: None
Priority: 5
Submitted By: Nobody/Anonymous (nobody)
Assigned to: Martijn Dashorst (dashorst)
Summary: clickButton() when button ist not in first form!

Initial Comment:
to use the clickButton(buttonName or ID) method nedd 
to have just one form in wensite , but when you have 2 
forms or more then you can finde submit the buttons in 
first form.

i have fixed this Bug allready but i can not commit it to 
CVS , because of that i ask the developer to commit this 
changes after testing it (i did and it works nice)

/**
  * @return the HttpUnit Button with a given id.
  * 
  * @param buttonId
  */
    public Button getButton(String buttonId)
    {
      int formCount = getFormCount();
      for(int i = 0; i < formCount; i++)
          if(getForm(i).getButtonWithID(buttonId) != null)
              return getForm(i).getButtonWithID(buttonId);

      return null;
    }
         

----------------------------------------------------------------------

>Comment By: Julien HENRY (henryju)
Date: 2006-06-22 11:33

Message:
Logged In: YES 
user_id=1235926

done.

----------------------------------------------------------------------

Comment By: Martijn Dashorst (dashorst)
Date: 2004-06-15 18:51

Message:
Logged In: YES 
user_id=695103

I'll look into it.

----------------------------------------------------------------------

Comment By: Saleh matani (matani)
Date: 2004-06-14 09:53

Message:
Logged In: YES 
user_id=923609

The TestCase

//-------------------------------------------------

package net.sourceforge.jwebunit;

public class ButtonclickTest extends JWebUnitTest
{
    public void setUp() throws Exception {
        super.setUp();
    }

  private void defineWebpagewithOneform() {
        defineWebPage("pagewithOneform", "This is a test 
Button click page." +
                                  "<html>"+
                                  "<form name=\"form1\"><button 
id=\"buton1\">Testbutton</button>" +
                                  "</html>");
    }
    
      
  private void defineWebpagewithtowforms() {
        defineWebPage("pagewithTowforms", "This is a test 
Button click page." +
                                  "<html>"+
                                  "<form name=\"form1\"><button 
id=\"buton1\">Testbutton</button></form>" +
                                  "<form name=\"form2\"><button 
id=\"buton2\">Testbutton2</button></form>" +
                                  "</html>");
    }
    
  public void testAssertButtonwithOneFormfound()
  {
    defineWebpagewithOneform();
     beginAt("/pagewithOneform.html");
     assertButtonPresent("buton1");
  }

  public void testAssertButtonwithTowFormsfound()
  {
    defineWebpagewithtowforms();
     beginAt("/pagewithTowforms.html");
     assertButtonPresent("buton1");
     assertButtonPresent("buton2");
  }
    
}
//---- without my bugfix the Test will fail  (matani)

----------------------------------------------------------------------

Comment By: Nobody/Anonymous (nobody)
Date: 2004-06-09 18:27

Message:
Logged In: NO 

Can you provide a test case to with this please?

----------------------------------------------------------------------

Comment By: Saleh matani (matani)
Date: 2004-06-09 16:47

Message:
Logged In: YES 
user_id=923609

Assigned To:matani
[EMAIL PROTECTED]

i forgot to login as i wrote this Bug!

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=497982&aid=969653&group_id=61302

All the advantages of Linux Managed Hosting--Without the Cost and Risk!
Fully trained technicians. The highest number of Red Hat certifications in
the hosting industry. Fanatical Support. Click to learn more
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=107521&bid=248729&dat=121642
_______________________________________________
Jwebunit-development mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jwebunit-development

Reply via email to