我正在使用关键字驱动的Web应用程序框架,其中在我的应用程序中集成了三个应用程序,我们对三个应用程序使用相同的关键字,现在我希望使用相同的关键字来执行这三个应用程序,而不是维护3个应用程序的3个函数库,因为现在3个应用程序的页面标题是相同的,我想基于程序类型执行这些应用程序。
函数库1:
Function openBrowserUrl()
Application one Function
End Function函数库二:
Function openBrowserUrl()
Application Two Function
End Function函数库三:
Function openBrowserUrl()
Application Three Function
End Function现在我想组合成一个唯一的函数,然后它应该像这样工作。
If App_one="Y" then
Application one - use same unique function
Different Credentials
End If
If App_Two="Y" then
Application Two - use same unique function
Different Credentials
End If
If App_Three="Y" then
Application Three - use same unique function
Different Credentials
End If请提供如何实现此目标的解决方案
发布于 2017-07-25 21:26:49
好吧那就很简单了..。不需要使用任何if else语句,只需使用参数即可。
函数库1:
Function openBrowserUrl()
StrUserId = "ID1"
StrPwd = "pwd1"
f_Login(StrUserId, StrPwd)
End Function函数库二:
Function openBrowserUrl()
StrUserId = "ID2"
StrPwd = "pwd2"
f_Login(StrUserId, StrPwd)
End Function函数库三:
Function openBrowserUrl()
StrUserId = "ID3"
StrPwd = "pwd3"
f_Login(StrUserId, StrPwd)
End Function登录函数
f_Login(StrUserId, StrPwd)
' Enter the code for login here.
End function此外,您还可以将openBrowserUrl函数组合为一个。
Function openBrowserUrl(strURL, strUserId, strPwd)
'open browser and login here
End functionhttps://stackoverflow.com/questions/45301791
复制相似问题