My test case steps are below. a) Open the Page (<some URL>) b) Verify Text Field "t1" is prensent c) Verify button "go" is present. d) Verify dropdown "dr1" present. e) Verify radio "rd1" present.
Now if the first verification fails (Verification point b ) the other Verification c to e will not get executed. My requirement is to make sure even though the first verification point fails it should continue with other assert statements, however the whole testcases should show as Failed. How do I make this work using TestNG.
> My test case steps are below.
> a) Open the Page (<some URL>)
> b) Verify Text Field "t1" is prensent
> c) Verify button "go" is present.
> d) Verify dropdown "dr1" present.
> e) Verify radio "rd1" present.
> Now if the first verification fails (Verification point b ) the other
> Verification c to e will not get executed. My requirement is to make sure
> even though the first verification point fails it should continue with other
> assert statements, however the whole testcases should show as Failed. How do
> I make this work using TestNG.
Yes, that's the best way. You might want to add a message to this approach
so that the final assert will fail with an error that will tell you exactly
which boolean was false...
-- Cedric
2009/6/24 konstantin <konstantin.a.sa...@gmail.com>
> On 24 июн, 13:52, Manjunath Bellur <manjunath.bel...@gmail.com> wrote:
> > Hi, I am using Selenium RC and TestNG. I have a testcase written to
> > verify multiple point in a page.
> > My test case steps are below.
> > a) Open the Page (<some URL>)
> > b) Verify Text Field "t1" is prensent
> > c) Verify button "go" is present.
> > d) Verify dropdown "dr1" present.
> > e) Verify radio "rd1" present.
> > Now if the first verification fails (Verification point b ) the other
> > Verification c to e will not get executed. My requirement is to make sure
> > even though the first verification point fails it should continue with
> other
> > assert statements, however the whole testcases should show as Failed. How
> do
> > I make this work using TestNG.
Thanks Konstantin and Cedric, This is a nice idea. However every
testcase having this kind of verification would have many boolean variables
declared, which may be cumbersome and confusing.
Cedric : Would that be a good idea to extend the current assert* statements
to Verify and Continue. *assert** can take an extra parameter (TRUE or
FALSE (default to False)). This means the execution of next steps will
continue if TRUE is passed, else would come out of testcases. However in
both the cases if any step has failed the whole testcase is marked as
Failed.
If you agree with this, will be eagerly waiting for the next version of
TestNG. :)
> Yes, that's the best way. You might want to add a message to this approach
> so that the final assert will fail with an error that will tell you exactly
> which boolean was false...
> --
> Cedric
> 2009/6/24 konstantin <konstantin.a.sa...@gmail.com>
>> On 24 июн, 13:52, Manjunath Bellur <manjunath.bel...@gmail.com> wrote:
>> > Hi, I am using Selenium RC and TestNG. I have a testcase written to
>> > verify multiple point in a page.
>> > My test case steps are below.
>> > a) Open the Page (<some URL>)
>> > b) Verify Text Field "t1" is prensent
>> > c) Verify button "go" is present.
>> > d) Verify dropdown "dr1" present.
>> > e) Verify radio "rd1" present.
>> > Now if the first verification fails (Verification point b ) the other
>> > Verification c to e will not get executed. My requirement is to make
>> sure
>> > even though the first verification point fails it should continue with
>> other
>> > assert statements, however the whole testcases should show as Failed.
>> How do
>> > I make this work using TestNG.
You can do this in your project. assert* - just static method which
call fail() in some condition. So you can define these conditions,
make your own assertCollectionTrue(Collection<Boolean>) or something
like this.
On 25 июн, 10:48, Manjunath Bellur <manjunath.bel...@gmail.com> wrote:
> Thanks Konstantin and Cedric, This is a nice idea. However every
> testcase having this kind of verification would have many boolean variables
> declared, which may be cumbersome and confusing.
> Cedric : Would that be a good idea to extend the current assert* statements
> to Verify and Continue. *assert** can take an extra parameter (TRUE or
> FALSE (default to False)). This means the execution of next steps will
> continue if TRUE is passed, else would come out of testcases. However in
> both the cases if any step has failed the whole testcase is marked as
> Failed.
> If you agree with this, will be eagerly waiting for the next version of
> TestNG. :)
> > Yes, that's the best way. You might want to add a message to this approach
> > so that the final assert will fail with an error that will tell you exactly
> > which boolean was false...
> > --
> > Cedric
> > 2009/6/24 konstantin <konstantin.a.sa...@gmail.com>
> >> On 24 июн, 13:52, Manjunath Bellur <manjunath.bel...@gmail.com> wrote:
> >> > Hi, I am using Selenium RC and TestNG. I have a testcase written to
> >> > verify multiple point in a page.
> >> > My test case steps are below.
> >> > a) Open the Page (<some URL>)
> >> > b) Verify Text Field "t1" is prensent
> >> > c) Verify button "go" is present.
> >> > d) Verify dropdown "dr1" present.
> >> > e) Verify radio "rd1" present.
> >> > Now if the first verification fails (Verification point b ) the other
> >> > Verification c to e will not get executed. My requirement is to make
> >> sure
> >> > even though the first verification point fails it should continue with
> >> other
> >> > assert statements, however the whole testcases should show as Failed.
> >> How do
> >> > I make this work using TestNG.
Yes, like Konstantin is saying, it's probably preferable for you to write
these extended assert methods for the cases you need. There are a lot of
assert methods in the TestNG classes and I don't think that adding a boolean
to all of them (or duplicating the existing methods) is worth it.
But I'm thinking of a more general system that might be of assistance to you
in order to solve the kind of problem you're encountering, I'll try to find
some time to write a blog post about it and I'll let you know.
-- Cedric
On Thu, Jun 25, 2009 at 5:05 AM, konstantin <konstantin.a.sa...@gmail.com>wrote:
> You can do this in your project. assert* - just static method which
> call fail() in some condition. So you can define these conditions,
> make your own assertCollectionTrue(Collection<Boolean>) or something
> like this.
> On 25 июн, 10:48, Manjunath Bellur <manjunath.bel...@gmail.com> wrote:
> > Thanks Konstantin and Cedric, This is a nice idea. However every
> > testcase having this kind of verification would have many boolean
> variables
> > declared, which may be cumbersome and confusing.
> > Cedric : Would that be a good idea to extend the current assert*
> statements
> > to Verify and Continue. *assert** can take an extra parameter (TRUE or
> > FALSE (default to False)). This means the execution of next steps will
> > continue if TRUE is passed, else would come out of testcases. However in
> > both the cases if any step has failed the whole testcase is marked as
> > Failed.
> > If you agree with this, will be eagerly waiting for the next version of
> > TestNG. :)
> > > Yes, that's the best way. You might want to add a message to this
> approach
> > > so that the final assert will fail with an error that will tell you
> exactly
> > > which boolean was false...
> > > --
> > > Cedric
> > > 2009/6/24 konstantin <konstantin.a.sa...@gmail.com>
> > >> On 24 июн, 13:52, Manjunath Bellur <manjunath.bel...@gmail.com>
> wrote:
> > >> > Hi, I am using Selenium RC and TestNG. I have a testcase written
> to
> > >> > verify multiple point in a page.
> > >> > My test case steps are below.
> > >> > a) Open the Page (<some URL>)
> > >> > b) Verify Text Field "t1" is prensent
> > >> > c) Verify button "go" is present.
> > >> > d) Verify dropdown "dr1" present.
> > >> > e) Verify radio "rd1" present.
> > >> > Now if the first verification fails (Verification point b ) the
> other
> > >> > Verification c to e will not get executed. My requirement is to make
> > >> sure
> > >> > even though the first verification point fails it should continue
> with
> > >> other
> > >> > assert statements, however the whole testcases should show as
> Failed.
> > >> How do
> > >> > I make this work using TestNG.
> Yes, like Konstantin is saying, it's probably preferable for you to write
> these extended assert methods for the cases you need. There are a lot of
> assert methods in the TestNG classes and I don't think that adding a boolean
> to all of them (or duplicating the existing methods) is worth it.
> But I'm thinking of a more general system that might be of assistance to
> you in order to solve the kind of problem you're encountering, I'll try to
> find some time to write a blog post about it and I'll let you know.
> --
> Cedric
> On Thu, Jun 25, 2009 at 5:05 AM, konstantin <konstantin.a.sa...@gmail.com>wrote:
>> You can do this in your project. assert* - just static method which
>> call fail() in some condition. So you can define these conditions,
>> make your own assertCollectionTrue(Collection<Boolean>) or something
>> like this.
>> On 25 июн, 10:48, Manjunath Bellur <manjunath.bel...@gmail.com> wrote:
>> > Thanks Konstantin and Cedric, This is a nice idea. However every
>> > testcase having this kind of verification would have many boolean
>> variables
>> > declared, which may be cumbersome and confusing.
>> > Cedric : Would that be a good idea to extend the current assert*
>> statements
>> > to Verify and Continue. *assert** can take an extra parameter (TRUE or
>> > FALSE (default to False)). This means the execution of next steps will
>> > continue if TRUE is passed, else would come out of testcases. However in
>> > both the cases if any step has failed the whole testcase is marked as
>> > Failed.
>> > If you agree with this, will be eagerly waiting for the next version of
>> > TestNG. :)
>> > > Yes, that's the best way. You might want to add a message to this
>> approach
>> > > so that the final assert will fail with an error that will tell you
>> exactly
>> > > which boolean was false...
>> > > --
>> > > Cedric
>> > > 2009/6/24 konstantin <konstantin.a.sa...@gmail.com>
>> > >> On 24 июн, 13:52, Manjunath Bellur <manjunath.bel...@gmail.com>
>> wrote:
>> > >> > Hi, I am using Selenium RC and TestNG. I have a testcase written
>> to
>> > >> > verify multiple point in a page.
>> > >> > My test case steps are below.
>> > >> > a) Open the Page (<some URL>)
>> > >> > b) Verify Text Field "t1" is prensent
>> > >> > c) Verify button "go" is present.
>> > >> > d) Verify dropdown "dr1" present.
>> > >> > e) Verify radio "rd1" present.
>> > >> > Now if the first verification fails (Verification point b ) the
>> other
>> > >> > Verification c to e will not get executed. My requirement is to
>> make
>> > >> sure
>> > >> > even though the first verification point fails it should continue
>> with
>> > >> other
>> > >> > assert statements, however the whole testcases should show as
>> Failed.
>> > >> How do
>> > >> > I make this work using TestNG.
Hi Cedric, Thanks for the blog. I would have the assertsoft as mentioned
by you. However, it would be good if the Framework itself provides this
feature. Like me, many other will also be or may face the same problem. :).
>> Yes, like Konstantin is saying, it's probably preferable for you to write
>> these extended assert methods for the cases you need. There are a lot of
>> assert methods in the TestNG classes and I don't think that adding a boolean
>> to all of them (or duplicating the existing methods) is worth it.
>> But I'm thinking of a more general system that might be of assistance to
>> you in order to solve the kind of problem you're encountering, I'll try to
>> find some time to write a blog post about it and I'll let you know.
>> --
>> Cedric
>> On Thu, Jun 25, 2009 at 5:05 AM, konstantin <konstantin.a.sa...@gmail.com
>> > wrote:
>>> You can do this in your project. assert* - just static method which
>>> call fail() in some condition. So you can define these conditions,
>>> make your own assertCollectionTrue(Collection<Boolean>) or something
>>> like this.
>>> On 25 июн, 10:48, Manjunath Bellur <manjunath.bel...@gmail.com> wrote:
>>> > Thanks Konstantin and Cedric, This is a nice idea. However every
>>> > testcase having this kind of verification would have many boolean
>>> variables
>>> > declared, which may be cumbersome and confusing.
>>> > Cedric : Would that be a good idea to extend the current assert*
>>> statements
>>> > to Verify and Continue. *assert** can take an extra parameter (TRUE or
>>> > FALSE (default to False)). This means the execution of next steps will
>>> > continue if TRUE is passed, else would come out of testcases. However
>>> in
>>> > both the cases if any step has failed the whole testcase is marked as
>>> > Failed.
>>> > If you agree with this, will be eagerly waiting for the next version of
>>> > TestNG. :)
>>> > > Yes, that's the best way. You might want to add a message to this
>>> approach
>>> > > so that the final assert will fail with an error that will tell you
>>> exactly
>>> > > which boolean was false...
>>> > > --
>>> > > Cedric
>>> > > 2009/6/24 konstantin <konstantin.a.sa...@gmail.com>
>>> > >> On 24 июн, 13:52, Manjunath Bellur <manjunath.bel...@gmail.com>
>>> wrote:
>>> > >> > Hi, I am using Selenium RC and TestNG. I have a testcase
>>> written to
>>> > >> > verify multiple point in a page.
>>> > >> > My test case steps are below.
>>> > >> > a) Open the Page (<some URL>)
>>> > >> > b) Verify Text Field "t1" is prensent
>>> > >> > c) Verify button "go" is present.
>>> > >> > d) Verify dropdown "dr1" present.
>>> > >> > e) Verify radio "rd1" present.
>>> > >> > Now if the first verification fails (Verification point b ) the
>>> other
>>> > >> > Verification c to e will not get executed. My requirement is to
>>> make
>>> > >> sure
>>> > >> > even though the first verification point fails it should continue
>>> with
>>> > >> other
>>> > >> > assert statements, however the whole testcases should show as
>>> Failed.
>>> > >> How do
>>> > >> > I make this work using TestNG.
>>> > >> > Please help me on solving this problem.
Noted. Be sure to read the comments, a few people have already chimed in
and offered improvements on the original idea. I'll wait to see how this
unfolds before deciding what TestNG could provide.
> Hi Cedric, Thanks for the blog. I would have the assertsoft as
> mentioned by you. However, it would be good if the Framework itself provides
> this feature. Like me, many other will also be or may face the same problem.
> :).
>>> Yes, like Konstantin is saying, it's probably preferable for you to
>>> write these extended assert methods for the cases you need. There are a lot
>>> of assert methods in the TestNG classes and I don't think that adding a
>>> boolean to all of them (or duplicating the existing methods) is worth it.
>>> But I'm thinking of a more general system that might be of assistance to
>>> you in order to solve the kind of problem you're encountering, I'll try to
>>> find some time to write a blog post about it and I'll let you know.
>>> --
>>> Cedric
>>> On Thu, Jun 25, 2009 at 5:05 AM, konstantin <
>>> konstantin.a.sa...@gmail.com> wrote:
>>>> You can do this in your project. assert* - just static method which
>>>> call fail() in some condition. So you can define these conditions,
>>>> make your own assertCollectionTrue(Collection<Boolean>) or something
>>>> like this.
>>>> On 25 июн, 10:48, Manjunath Bellur <manjunath.bel...@gmail.com> wrote:
>>>> > Thanks Konstantin and Cedric, This is a nice idea. However
>>>> every
>>>> > testcase having this kind of verification would have many boolean
>>>> variables
>>>> > declared, which may be cumbersome and confusing.
>>>> > Cedric : Would that be a good idea to extend the current assert*
>>>> statements
>>>> > to Verify and Continue. *assert** can take an extra parameter (TRUE
>>>> or
>>>> > FALSE (default to False)). This means the execution of next steps will
>>>> > continue if TRUE is passed, else would come out of testcases. However
>>>> in
>>>> > both the cases if any step has failed the whole testcase is marked as
>>>> > Failed.
>>>> > If you agree with this, will be eagerly waiting for the next version
>>>> of
>>>> > TestNG. :)
>>>> > > Yes, that's the best way. You might want to add a message to this
>>>> approach
>>>> > > so that the final assert will fail with an error that will tell you
>>>> exactly
>>>> > > which boolean was false...
>>>> > > --
>>>> > > Cedric
>>>> > > 2009/6/24 konstantin <konstantin.a.sa...@gmail.com>
>>>> > >> Manjunath,
>>>> > >> you can do this way:
>>>> > >> On 24 июн, 13:52, Manjunath Bellur <manjunath.bel...@gmail.com>
>>>> wrote:
>>>> > >> > Hi, I am using Selenium RC and TestNG. I have a testcase
>>>> written to
>>>> > >> > verify multiple point in a page.
>>>> > >> > My test case steps are below.
>>>> > >> > a) Open the Page (<some URL>)
>>>> > >> > b) Verify Text Field "t1" is prensent
>>>> > >> > c) Verify button "go" is present.
>>>> > >> > d) Verify dropdown "dr1" present.
>>>> > >> > e) Verify radio "rd1" present.
>>>> > >> > Now if the first verification fails (Verification point b ) the
>>>> other
>>>> > >> > Verification c to e will not get executed. My requirement is to
>>>> make
>>>> > >> sure
>>>> > >> > even though the first verification point fails it should continue
>>>> with
>>>> > >> other
>>>> > >> > assert statements, however the whole testcases should show as
>>>> Failed.
>>>> > >> How do
>>>> > >> > I make this work using TestNG.
>>>> > >> > Please help me on solving this problem.
Sure, Thanks for the help :). If you decide on implementing in TestNG
itself, just let me know and I will be ready to grab the next version of
TestNG.
Thanks and Regards
Manjunath
> Noted. Be sure to read the comments, a few people have already chimed in
> and offered improvements on the original idea. I'll wait to see how this
> unfolds before deciding what TestNG could provide.
> Hi Cedric, Thanks for the blog. I would have the assertsoft as
>> mentioned by you. However, it would be good if the Framework itself provides
>> this feature. Like me, many other will also be or may face the same problem.
>> :).
>>>> Yes, like Konstantin is saying, it's probably preferable for you to
>>>> write these extended assert methods for the cases you need. There are a lot
>>>> of assert methods in the TestNG classes and I don't think that adding a
>>>> boolean to all of them (or duplicating the existing methods) is worth it.
>>>> But I'm thinking of a more general system that might be of assistance to
>>>> you in order to solve the kind of problem you're encountering, I'll try to
>>>> find some time to write a blog post about it and I'll let you know.
>>>> --
>>>> Cedric
>>>> On Thu, Jun 25, 2009 at 5:05 AM, konstantin <
>>>> konstantin.a.sa...@gmail.com> wrote:
>>>>> You can do this in your project. assert* - just static method which
>>>>> call fail() in some condition. So you can define these conditions,
>>>>> make your own assertCollectionTrue(Collection<Boolean>) or something
>>>>> like this.
>>>>> On 25 июн, 10:48, Manjunath Bellur <manjunath.bel...@gmail.com> wrote:
>>>>> > Thanks Konstantin and Cedric, This is a nice idea. However
>>>>> every
>>>>> > testcase having this kind of verification would have many boolean
>>>>> variables
>>>>> > declared, which may be cumbersome and confusing.
>>>>> > Cedric : Would that be a good idea to extend the current assert*
>>>>> statements
>>>>> > to Verify and Continue. *assert** can take an extra parameter (TRUE
>>>>> or
>>>>> > FALSE (default to False)). This means the execution of next steps
>>>>> will
>>>>> > continue if TRUE is passed, else would come out of testcases. However
>>>>> in
>>>>> > both the cases if any step has failed the whole testcase is marked as
>>>>> > Failed.
>>>>> > If you agree with this, will be eagerly waiting for the next version
>>>>> of
>>>>> > TestNG. :)
>>>>> > > Yes, that's the best way. You might want to add a message to this
>>>>> approach
>>>>> > > so that the final assert will fail with an error that will tell you
>>>>> exactly
>>>>> > > which boolean was false...
>>>>> > > --
>>>>> > > Cedric
>>>>> > > 2009/6/24 konstantin <konstantin.a.sa...@gmail.com>
>>>>> > >> Manjunath,
>>>>> > >> you can do this way:
>>>>> > >> On 24 июн, 13:52, Manjunath Bellur <manjunath.bel...@gmail.com>
>>>>> wrote:
>>>>> > >> > Hi, I am using Selenium RC and TestNG. I have a testcase
>>>>> written to
>>>>> > >> > verify multiple point in a page.
>>>>> > >> > My test case steps are below.
>>>>> > >> > a) Open the Page (<some URL>)
>>>>> > >> > b) Verify Text Field "t1" is prensent
>>>>> > >> > c) Verify button "go" is present.
>>>>> > >> > d) Verify dropdown "dr1" present.
>>>>> > >> > e) Verify radio "rd1" present.
>>>>> > >> > Now if the first verification fails (Verification point b ) the
>>>>> other
>>>>> > >> > Verification c to e will not get executed. My requirement is to
>>>>> make
>>>>> > >> sure
>>>>> > >> > even though the first verification point fails it should
>>>>> continue with
>>>>> > >> other
>>>>> > >> > assert statements, however the whole testcases should show as
>>>>> Failed.
>>>>> > >> How do
>>>>> > >> > I make this work using TestNG.
>>>>> > >> > Please help me on solving this problem.