class NewUiModule extends DslContext { public void defineUi() { ui.Form(uid: "Regform", clocator: [tag: "form", action: "/s-c-i-reg.do", name: "regform", id: "regform", method: "post"]){ InputBox(uid: "RegEmail", clocator: [tag: "input", type: "text", class: "inputtext", id: "regEmail", name: "regEmail"]) InputBox(uid: "Pwd", clocator: [tag: "input", type: "password", class: "inputtext", id: "pwd", name: "pwd"]) InputBox(uid: "Name", clocator: [tag: "input", type: "text", class: "inputtext", id: "name", name: "name"]) RadioButton(uid: "Female", clocator: [tag: "input", type: "radio", value: "女生", id: "female", name: "gender"]) Selector(uid: "Birth_year", clocator: [tag: "select", name: "birth_year"]) Selector(uid: "Birth_month", clocator: [tag: "select", name: "birth_month"]) Selector(uid: "Birth_day", clocator: [tag: "select", name: "birth_day"]) Selector(uid: "Stage", clocator: [tag: "select", name: "stage", id: "stage"]) InputBox(uid: "Icode", clocator: [tag: "input", type: "text", class: "inputtext validate-code", id: "icode", name: "icode"]) Container(uid: "D_email", clocator: [tag: "dl", direct: "true", id: "d_email"]){ UrlLink(uid: "Xid_reg_handle", clocator: [tag: "a", text: "帐号", id: "xid_reg_handle"]) UrlLink(uid: "A", clocator: [tag: "a", text: "手机号"]) } Container(uid: "Dl_gender", clocator: [tag: "dl", direct: "true", class: "dl_gender"]){ RadioButton(uid: "Male", clocator: [tag: "input", type: "radio", value: "男生", id: "male", name: "gender"]) } } connectSeleniumServer() connectUrl "http://reg.renren.com/xn6245.do?ss=·0··3&rt=27" type "Regform.RegEmail", "dddd" type "Regform.RegEmail", "chongshi" type "Regform.Pwd", "·23456" type "Regform.Name", "小三" click "Regform.Female" selectByLabel "Regform.Birth_year", "80后" selectByLabel "Regform.Birth_month", "7" selectByLabel "Regform.Birth_day", "8" selectByLabel "Regform.Birth_day", "7" selectByLabel "Regform.Stage", "已经工作了" type "Regform.Icode", "漂亮宝贝" } //Add your methods here public void searchDownload(String keyword) { keyType "TelluriumDownload.Input", keyword click "TelluriumDownload.Search" waitForPageToLoad 30000 } public String[] getAllDownloadTypes() { return getSelectOptions("TelluriumDownload.DownloadType") } public void selectDownloadType(String type) { selectByLabel "TelluriumDownload.DownloadType", type } } |