我在运行测试时使用 Selenium RC 和 Chrome,它给了我这个错误
error(1340708572726): Unexpected Exception: Object [object HTMLIFrameElement] has no method 'getCurrentWindow'
但是,我并不总是收到此错误。有时测试通过,有时测试失败。我将浏览器更改为 IE 并没有收到此错误。这是代码的相关部分
void editResumeInfo(String objective, String company, String jobDesc, String city, String phoneCountry, String phoneArea, String phoneNumb, String coleg, String certificateName, String certificateLocation, String seminarName, String seminarLocation, String notes){
selenium.type("id=objective", objective)
selenium.click("xpath=//html/body/div/div/div[3]/div/div[2]/div[3]/form/div/div/div[2]/div[3]/a")
selenium.select("id=experienceIndustry0", "label=Health Care")
selenium.select("name=experienceProfession", "label=Direct Support Professional")
selenium.select("id=experienceStartDate0_month", "label=May")
selenium.select("id=experienceStartDate0_year", "label=2006")
selenium.select("id=experienceEndDate0_month", "label=August")
selenium.select("id=experienceEndDate0_year", "label=2011")
selenium.type("id=experienceCompany0", company)
selenium.type("id=experienceJobDesc0", jobDesc)
selenium.type("id=experienceAddressCity0", city)
selenium.select("id=experienceAddressCountry0", "label=Guyana")
selenium.type("id=experiencePhoneCountryCode0", phoneCountry)
selenium.type("id=experienceAreaCode0", phoneArea)
selenium.type("id=experiencePhoneNumber0", phoneNumb)
selenium.click("xpath=//html/body/div[2]/div/div[3]/div/div[2]/div[3]/form/div/div/div[3]/div[3]/a")
selenium.select("id=educationLevel0", "label=Post Graduate")
selenium.select("id=educationDegree0", "label=Biomedical Science")
selenium.type("id=educationCollege0", coleg)
selenium.select("id=educationGradDate0_year", "label=2011")
selenium.type("id=certificateName0", certificateName)
selenium.type("id=certificateLocation0", certificateLocation)
selenium.select("id=certificateDate0_month", "label=May")
selenium.select("id=certificateDate0_year", "label=2004")
selenium.click("xpath=//html/body/div[2]/div/div[3]/div/div[2]/div[3]/form/div/div/div[4]/div[3]/a")
selenium.type("id=seminarName0", seminarName)
selenium.type("id=seminarLocation0", seminarLocation)
selenium.select("name=seminarDate_month", "label=March")
selenium.select("name=seminarDate_year", "label=2011")
selenium.type("id=skillNotes", notes)
selenium.clickAndWait("id=submit")
}
我正在调用这个方法
@Test
void objectiveFiveThousandInputShowSuccess(){
values=TestDataController.characterGen(5000)
editResumeInfo(values, "abcd", "this is job", "bangalore", "91", "0381", "232269876", "IIT", "test certificate", "bangalore", "test seminar", "delhi", "note" )
CheckSuccess()
}
@Test
void objectiveFieldOnNullInputShowSuccess(){
editResumeInfo("", "abcd", "this is job", "bangalore", "91", "0381", "232698376", "IIT", "test certificate", "bangalore", "test seminar", "delhi", "note" )
CheckSuccess()
}
@Test
void companyFieldOnFiveHundredShowSuccess(){
values=TestDataController.characterGen(500)
editResumeInfo("objective", values, "this is job", "bangalore", "91", "0381", "23269876", "IIT", "test certificate", "bangalore", "test seminar", "delhi", "note" )
CheckSuccess()
}