12-04-2013, 01:32 AM
Hi I’m Jagadeesh. It would be helpful to me, if anyone can provide me an idea to below problem
I’ve a scenario in which my script will be executing each test step line by line and for each test step it will report pass and fail result in html result page. If test step result is pass, it will proceed to next test step and further on. Similarly for failed cases it proceeds to next test step and executes it. Is it possible to stop the script when it fails?
Below is the sample outline script
So according to above script, it will call webEdit function and check whether object is displayed and visible and will enter value in webEdit textbox and result will be written as pass in html result, if all conditions are satisfied.
After completing above function, now it will call link function and will initiate execution .Here also it will check if object is displayed .
If success, it will go to next step. Let us assume link is not visible, here second step in this function fails and so result is written as fail and execution of third function begins( call WebButton_check).
What I need is entire execution should be stopped as previous test step is failed. Is there any function to run at back end, to stop the execution? When test step fails? Is there any solution to my problem?
(Please note I’ve multiple scenarios so “Exit Test/Exit function” is not applicable.)
Functions are
If possible please mail (visitjaga@gmail.com) me the solution as in my office I’ve limited access to outside website. I’ll not be able to check immediately. I’ve been strucked with this issue for pass 20 days.
Thanks& Regard’s
Jagadeesh Mani
visitjaga@gmail.com
I’ve a scenario in which my script will be executing each test step line by line and for each test step it will report pass and fail result in html result page. If test step result is pass, it will proceed to next test step and further on. Similarly for failed cases it proceeds to next test step and executes it. Is it possible to stop the script when it fails?
Below is the sample outline script
Code:
Call webEdit_check (“google”,”google”,”nametxtbox”,”xxxx”)
Call Link_check (strbrowser,strpage,strlink)
Call WebButton_check (strbrowser,strpage,strWebbutton)
So according to above script, it will call webEdit function and check whether object is displayed and visible and will enter value in webEdit textbox and result will be written as pass in html result, if all conditions are satisfied.
After completing above function, now it will call link function and will initiate execution .Here also it will check if object is displayed .
If success, it will go to next step. Let us assume link is not visible, here second step in this function fails and so result is written as fail and execution of third function begins( call WebButton_check).
What I need is entire execution should be stopped as previous test step is failed. Is there any function to run at back end, to stop the execution? When test step fails? Is there any solution to my problem?
(Please note I’ve multiple scenarios so “Exit Test/Exit function” is not applicable.)
Functions are
Code:
Function webEdit_check(strbrowser,strpage,strwebEdit,strvalue)
Testobject=Browser(strbrowser).Page(strpage).WebEdit(strlink)
If Testobject.exist(10) Then
blnvisible= testobject.getRoproperty(visible)
If blnvisible =True Then
Testobject.set strvalue
Environment.value(result)=pass
‘It will write result to html page
Call html (“test step is success”,Environment(result))
Else
Environment.value(result)=fail
Call html (“test step is fail”,Environment(result))
End If
Else
Environment.value(result)=fail
Call html (“test object is not visible fail”,Environment(result))
End If
End Function
Function Link_check(strbrowser,strpage,strLink)
Testobject=Browser(strbrowser).Page(strpage).Link(strlink)
If Testobject.exist(10) Then
blnvisible= testobject.getRoproperty(visible)
If blnvisible =True Then
Testobject.click
Environment.value(result)=pass
‘It will write result to html page
Call html (“test step is success”,Environment(result))
Else
Environment.value(result)=fail
Call html (“test step is fail”,Environment(result))
End If
Else
Environment.value(result)=fail
Call html (“test object is not visible fail”,Environment(result))
End If
End Function
Function WebButton_check(strbrowser,strpage,strWebButton)
Testobject=Browser(strbrowser).Page(strpage).WebButton(strWebButton)
If Testobject.exist(10) Then
blnvisible= testobject.getRoproperty(visible)
If blnvisible =True Then
Testobject.click
Environment.value(result)=pass
‘It will write result to html page
Call html (“test step is success”,Environment(result))
Else
Environment.value(result)=fail
Call html (“test step is fail”,Environment(result))
End If
Else
Environment.value(result)=fail
Call html (“test object is not visible fail”,Environment(result))
End If
End Function
Environment.value(result)=fail
Call html (“test step is fail”,Environment(result))
Function (strverify,Result)
If Environment(result)=pass Then
Td.write(<td(strverify)/>td<xxx><td(Result)/>td)
(please note this is sample, which I typed, it’s just for concept)
Else
Td.write(<td(strverify)/>td<xxx><td(Result)/>td)
End If
End Function
Thanks& Regard’s
Jagadeesh Mani
visitjaga@gmail.com