I have the following code to click on a link of an specific page. I just want to click on that link if exists. For some reason this is not working. Does anyone know a better solution for this?
static class PictureGallery {
public static def goTo = { url , category, ant ->
Listing.goTo url, category, ant
ant.storeXPath(xpath:"boolean(//span[@id='listing-gallery-toggle'])", property:"elementPresent")
ant.ifStep (test:"elementPresent"){
ant.clickLink description:"Clicks picture Gallery Link", htmlId:'listing-gallery-toggle-gallery' , savePrefix:'picturegallery' , saveResponse:'true'
}
}
}
Thanks,
Hernan