예제 #1
0
파일: craft.py 프로젝트: tylersavery/spy
 #spy.browser.execute_script("window.scrollTo(0, document.body.scrollHeight);")
 
 #1. validate url ------------------------
 spy.testId = 1
 if(spy.browser):
     spy.logSuccess("Page Loaded", spy.testId)
     print spy.urlToTest
 else:
     spy.logFail("Page NOT Loaded", spy.testId)
 
 #2 get family fun url
 #temp hard coded url (use john's meta tag to get)
 spy.testId = 2
 
 try:
     hidden_box = spy.find('input[type="hidden"]')
     
     original_url = hidden_box.get_attribute('value')
     spoonful_url = u
     
     #3 Query Original URL
     browser2 = spy.resolveBrowser(spy.whichBrowser)
     spy.testId = 3
     
     try:
         browser2.get(original_url)
         spy.logSuccess("Loaded " + original_url, spy.testId)
     except spy.NoSuchElementException:
         spy.logFail("Couldn't Load " + original_url, spy.testId)