Advertisement
Guest User

Untitled

a guest
Aug 4th, 2015
194
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.68 KB | None | 0 0
  1. '''
  2. Test selenium actions
  3. '''
  4.  
  5. import time
  6.  
  7. from bl.facade              import AccountPoolInitializer
  8. from bl.facade              import TelcoTestCase
  9. from bl.facade              import TestCaseId
  10. from bl.facade              import TestMethod
  11. from bl.facade              import log
  12. from bl.infra.selenium.api  import CallRecord
  13.  
  14. @TestCaseId('selenium_sample')
  15.  
  16. class MediaProcessorSample(TelcoTestCase):
  17.  
  18.     @AccountPoolInitializer
  19.     def accountpool(self):
  20.         pass
  21.  
  22.     @TestMethod
  23.     def selenium_sample(self):
  24.        
  25.         with self.new_step('Init selenium...'):
  26.             selenium = CallRecord()
  27.             selenium.open('http://test_sip_service.net')
  28.             selenium.type_login('1111111111')
  29.             selenium.type_password('55555555')
  30.             selenium.click_submit_login()
  31.             selenium.try_accept_alert('Attempting to login as system extension')
  32.             selenium.open('http://test_sip_service.net/company/index.html')
  33.             selenium.click_users_button()
  34.             selenium.click_extension_button('101')
  35.             selenium.click_call_screening_button()
  36.             selenium._click_by_xpath('//*[text()="Custom"]')
  37.            
  38.             #/mobile/api/proxy.html?cmd=rules.downloadGreeting&gid=96511008
  39.             aaa = selenium.wait_element('//*[@id="wigRecorder-downloadButton"]/a').get_attribute("href")
  40.             log.info('........................................%s'%aaa)
  41. #            bbb = '/mobile/api/proxy.html?cmd=rules.downloadGreeting&gid=96511008'
  42.             path = selenium.download_file(cookies=selenium.get_cookies(), file_name='aaa')
  43.             log.info('path to file: %s'%path)
  44.             time.sleep(5)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement