Вы находитесь на странице: 1из 4

Function launchwebapp(broption,url) 'LaunchWebApplication On Error Resume Next broption=trim(broption) url=trim(url) If broption="" or url="" Then launchwebapp="invalid input give n"

'SystemUtil.Run "iexplore.exe"," www.google.com" else SystemUtil.Run "iexplore.exe","w ww.policymagic.co.in" launchwebapp="pass" End If End Function

===== Function logResult(stepName,stepDesc,stepFlag) 'LogResult If stepFlag = "pass" Then reporter.ReportEvent mic Pass,stepName,stepdesc else reporter.ReportEvent mic Fail,stepName,stepDesc&stepFlag End If End Function ===== Function contextWrapper(arrayofelements) 'Context Wrapper startIndex = Lbound(arrayofelements) endIndex = Ubound(arrayofelements) For index = startIndex to endIndex arrayval = arrayofelements(index) If arrayval="" Then counter = counter +1 End If Next contextWrapper = counter End Function ===== Function validip(bname,pname,objtype,objname,expval) On error resume next If objtype="weblist" Then actval=browser(bname).page(pname).weblis t(objname).GetROProperty("value") End If If expval=actval and strcomp(expval,act val,1)=0 Then 'comparing actval and expval ' scmp=str comp(expval,actval,1) ' If scmp =0 Then validip="pass" else

validip="fail" ' End If ' ' err.number&vbtab&err.description ' r '

End If If err.number<>0 Then validip= err.clea End If

If objtype="webedit" Then actval=browser(bname).page(pname ).webedit(objname).GetROProperty("value") End If If expval=actval and strcomp(exp val,actval,1)=0 Then validip="pass" else validip="fail" End If If err.number<>0 Then validip=err.number&vbtab &err.description err.clear End If Exit function validip="pass" End Function Function logResult(stepName,stepDesc,sta tusFlag) If statusFlag = "pass" Then Reporter .ReportEvent micPass,stepName,stepDesc else Reporter .ReportEvent micFail,stepName,stepDesc End If End Function

' ,"w1","20 Lacs") ' ?" ' ue" ' sFlag) ' ' ,"dd","5") ' '

statusFlag=validip("CII","CII","weblist" stepName="How much insurance do you want stepDesc="to compare actual and exp val result=logResult(stepName,stepDesc,statu statusFlag=validip("CII","CII","weblist" stepName="Date Of Birth DD" stepDesc="to compare actual and exp val

ue" ' result=logResult(stepName,stepDesc,statu sFlag) ' ' statusFlag=validip("CII","CII","webedit" ,"name","ChAnDu") ' stepName="Enter Name TextBox" ' stepDesc="to compare actual and exp val ue" ' result=logResult(stepName,stepDesc,statu sFlag) ===== Function selectOperation(brn,pgn,objtype,objname,val) 'Select Operation On error resume next brn = trim(brn) pgn = trim(pgn) objtype = trim(objtype) objname = trim(objname) val = trim(val) arrayofelements = array(brn,objt ype,objname,val) nooferrors = contextWrapper(arra yofelements) If nooferrors>0 Then selectOperation = "inval id I/P's given" Exit function End If If objtype = "weblist" Then verifyflag = browser(brn ).page(pgn).weblist(objname).Exist If verifyflag Then allitems = brows er(brn).page(pgn).weblist(objname).GetROProperty("all items") strlocation = in str(allitems,val) If strlocation > 0 Then browser( brn).page(pgn).weblist(objname).Select val else selectOp eration = "Item"&vbtab&val&vbtab&"is not found in list" Exit Function End If End If else selectOp eration = "The objtype "&vbtab&objtype&"is not found in page" End If If err.number>0 Then selectOp eration = err.number&err.description err.clea r Exit function End If selectO

peration = "pass" End Function

Вам также может понравиться