Hello folks, I have been teaching myself Python over the last few months. My first project is a browser driver test case using the Selenium RC web driving framework (Not importing webdriver in my project though, so as not to confuse). Basically, my test case needs to hook into a refresh loop of a '.aspx' page that is written in JavaScript and HTML. This loop constantly refreshes this '.aspx' page until a 'sel.is_text_present("foo")' condition is satisfied. After refreshing until the defined 'text' appears the script is supposed to 'click' a JavaScript button that appears along with the 'is_text_present' string. Upon executing the script Firefox opens and directs itself to the specific page and enters its 'refresh loop', but when the text appears (i.e. the '.aspx' page changes its state and loads a JavaScript table with a JavaScript button) the script doesn't execute the other branch of the loop. Here is a snippet of code which shows the logic I have implemented:
i = sel.is_text_present("Schedule") #text that the test case is 'waiting' for
while i != True:
print i
print "Waiting for job..."
sel.refresh()
else:
print "Job found..."
sel.click("id=Select")
sel.wait_for_page_to_load("30000")
sel.click("id=1")
sel.wait_for_page_to_load("30000")
print "Success!"
test_py_s_f_t_c() #calls this function again to repeat the test case
Any suggestions, or 'pointings' in the right direction would be most helpful and appreciated! Looking forward to getting acquainted with this community! ^_^