Start the browser:
Self. Selenium = Selenium ("localhost", 4444, "* Firefox", "http: // 218.108.8.83: 2048 ")
Open the rootPage:
Sel. Open ("/")
Wait for element to exitNow:
Def waitforelement (self, elementname ):
For I in range (60 ):
Try:
If self. Selenium. is_element_present (elementname): Break
Country T: Pass
Time. Sleep (1)
Else: Self. Fail ("time out ")
TypeData:
Sel. Type ("// input [@ ID = 'programschedulemodel _ url']", "http://justNothing.com ")
Sel. Type ("// textarea [@ ID = 'programschedulemodel _ summary ']", U"Daman UniversityBattle little monsters")
Select the drop down list:
Sel. Select ("// select [@ ID = 'programschedulemodel _ starthour ']", "Index = % d" % starthour)
Sel. Select ("// select [@ ID = 'programschedulemodel _ startminute ']", "Index = 0 ")
Click the hyperlink:
Sel. Click (U "link = add playing schedule ")
Click the button under a form
Sel. Click ("// form [@ ID = 'program-schedule-model-form'] // input [@ name = 'yt0 ']")