def Open_Browser_Wrapper(step_data):
''' Temporary wrapper for open_browser() until that function can be updated to use only data_set '''
sModuleInfo = inspect.stack()[0][3] + " : " + inspect.getmoduleinfo(__file__).name
try:
global dependency
# Get the dependency again in case it was missed
if Shared_Resources.Test_Shared_Variables('dependency'): # Check if driver is already set in shared variables
dependency = Shared_Resources.Get_Shared_Variables('dependency') # Retreive selenium driver
cmd = step_data[0][2] # Expected "open" or "close" for current method. May contain other strings for old method of Field="open browser"
if cmd.lower().strip() == 'close': # User issued close command
try: selenium_driver.close()
except: pass
return 'passed'
else: # User issued "open" command or used old method of "open browser"
return Open_Browser(dependency)
except Exception:
ErrorMessage = "failed to open browser"
return CommonUtil.Exception_Handler(sys.exc_info(), None, ErrorMessage)
BuiltInFunctions.py 文件源码
python
阅读 22
收藏 0
点赞 0
评论 0
评论列表
文章目录