Forum Discussion
UPS_Support
13 years agoOccasional Contributor
That was helpful. After chaning the part is red, it worked.
Thank you!
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
import groovy.swing.SwingBuilder
import javax.swing.ImageIcon
import groovy.swing.SwingBuilder
import org.apache.commons.codec.binary.Base64
teststep=context.testCase.getTestStepAt(context.getCurrentStepIndex()).getLabel()
Image='$'+"{#Response#//ship:ShipmentResults/ship:PackageResults/ship:ShippingLabel/ship:GraphicImage}"Label=context.expand(Image)
b64 = new Base64()
swing = new groovy.swing.SwingBuilder()
i1 = swing.label(icon:new ImageIcon(b64.decode(Label.getBytes())))
frame = swing.frame(title:"Ship Label", defaultCloseOperation:javax.swing.WindowConstants.DISPOSE_ON_CLOSE) {
panel(){
widget(i1)
}
}
frame.pack()
frame.show()
Thank you!
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
import groovy.swing.SwingBuilder
import javax.swing.ImageIcon
import groovy.swing.SwingBuilder
import org.apache.commons.codec.binary.Base64
teststep=context.testCase.getTestStepAt(context.getCurrentStepIndex()).getLabel()
Image='$'+"{#Response#//ship:ShipmentResults/ship:PackageResults/ship:ShippingLabel/ship:GraphicImage}"Label=context.expand(Image)
b64 = new Base64()
swing = new groovy.swing.SwingBuilder()
i1 = swing.label(icon:new ImageIcon(b64.decode(Label.getBytes())))
frame = swing.frame(title:"Ship Label", defaultCloseOperation:javax.swing.WindowConstants.DISPOSE_ON_CLOSE) {
panel(){
widget(i1)
}
}
frame.pack()
frame.show()