package org.expressolivre.cte.pages.calendar; import org.expressolivre.cte.pages.common.Page; import org.openqa.selenium.WebDriver; /** * @author L.F.Estivalet (Serpro) * * Created on Feb 9, 2011 at 9:58:16 AM * */ public class CalendarTodayViewPage extends Page { public CalendarTodayViewPage(WebDriver driver) { super(driver); // TODO Auto-generated constructor stub } /** * Procura o "id" do compromisso baseado no titulo do mesmo. * * @param title * Titulo do compromisso. * @return "id" do compromisso. */ public String getAppointmentId(String title) { String source = driver.getPageSource(); int i = source.indexOf("\"title\":\"" + title); int j = source.indexOf("\"id\":", i); return source.substring(j + 5, source.indexOf(",", j)); } }