1 5 package org.exoplatform.test.web.unit; 6 7 import org.exoplatform.test.web.ExoWebClient; 8 import com.meterware.httpunit.*; 9 15 public class ClickImageLinkWithAltTextUnit extends WebUnit { 16 private String altText_ ; 17 18 public ClickImageLinkWithAltTextUnit(String name, String description) { 19 super(name, description) ; 20 } 21 22 public ClickImageLinkWithAltTextUnit setAltText(String text) { 23 altText_ = text ; 24 return this ; 25 } 26 27 public WebResponse execute(WebResponse previousResponse, WebTable block, 28 ExoWebClient client) throws Exception { 29 WebLink link = previousResponse.getLinkWithImageText(altText_); 30 return link.click() ; 31 } 32 33 public String getActionDescription() { 34 return "This web unit look for the image link with alt text '" + altText_ + "' and click on it"; 35 } 36 } | Popular Tags |