Menu

Button object help

Help
Rurouni
2005-07-05
2013-04-26
  • Rurouni

    Rurouni - 2005-07-05

    i'm trying to click on a button type object on one page to get to another page but it seems to not be working properly.  i need to get to that other page to access the images there.

    please advise.  thank u

    WebForm forms [] = response2.getForms();
                if( forms != null )
                {
                    //More than one form
                    for( int i = 0; i < forms.length; i++ )
                    {
                        Button parcelSketchButtons [] = forms[ i ].getButtons();
                        if( parcelSketchButtons.length != 0 )
                        {
                            //More than one button
                            for( int j = 0; j < parcelSketchButtons.length; j++ )
                            {
                                Button sketchButton = parcelSketchButtons[ j ];
                                sketchButton.click();
                                WebResponse sketchResponse = wc.getCurrentPage();
                                Toolkit.printSiteToFile( sketchResponse );
                                WebImage sketchImage [] = sketchResponse.getImages();
                               
                                //More than one image
                                for( int k = 0; k < sketchImage.length; k++ )
                                {
                                    String tempSource = sketchImage[ k ].getSource();
                                    if( tempSource.indexOf( "/cgi-bin/sumter_sketch.cgi" ) != -1 )
                                    {
                                        if( ssd.parcelSketch.equals( "" ) )
                                            ssd.parcelSketch = "<IMG CLASS=\"imageborder\" SRC=\"http://64.234.218.210" + sketchImage[ i ].getSource() + "\" HEIGHT=\"360\" WIDTH=\"488\">";
                                    }
                                }
                               
                            }  
                        }
                    }
                }

     
    • Rurouni

      Rurouni - 2005-07-05

      please ignore this line:

      Toolkit.printSiteToFile( sketchResponse );

      thank u

       

Log in to post a comment.

MongoDB Logo MongoDB