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\">";
}
}
}
}
}
}
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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\">";
}
}
}
}
}
}
please ignore this line:
Toolkit.printSiteToFile( sketchResponse );
thank u