How to assert whether a radio button is clicked or not.

288 vistas
Ir al primer mensaje no leído

Manasa Muchchatti

no leída,
28 ene 2013, 2:49:26 a. m.28/1/13
para robotium-...@googlegroups.com
Hi,

I have to check whether a radio button is clicked or not. Depending on this selection my testcases run. If A is selected do 123,if B is selected do 764.... etc.,

So sometimes click may go wrong(due to slow scrolling.,etc), so can there be possible to find out which radiobutton clicked and run its testcases,rather than failing it every time.


Thanks

Renas Reda

no leída,
29 ene 2013, 8:47:04 a. m.29/1/13
para Robotium Developers
Hi,

Can you please paste your test case?

/Renas

Manasa Muchchatti

no leída,
29 ene 2013, 8:58:36 a. m.29/1/13
para robotium-...@googlegroups.com
My testcase is to test Android Profile:

1.If Default is selected then in Manage profiles select wi-fi,data sync.
2.If Home is selected then in Manage profiles select Bluetooth,alarm
3.If work is selected then in Manage profiles select ....

Like this i have to enable apps,and do some settings change.

can we take screen shot and see which radio button is selected or return a radio buttons value as true if selected.

Taking screen shots,i dont like that approach as you have to take screen shot,compare it,depending on the comparision do stuff... i need a certain approach like this:

if(anyradiobutton==true)
    return indexofthatradiobutton.

--
You received this message because you are subscribed to the Google Groups "Robotium Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to robotium-develo...@googlegroups.com.
To post to this group, send email to robotium-...@googlegroups.com.



--
Thanks and Regards,
Manasa I M

Renas

no leída,
29 ene 2013, 9:59:22 a. m.29/1/13
para robotium-...@googlegroups.com
The reason why I am asking is because of this comment:

So sometimes click may go wrong(due to slow scrolling.,etc), so can there
> be possible to find out which radiobutton clicked

Have you tried to use any of the waitFor methods before actually clicking on the radiobutton? 

/Renas

Manasa Muchchatti

no leída,
30 ene 2013, 12:19:16 a. m.30/1/13
para robotium-...@googlegroups.com
No.. bcs i dont see how to use this waitFor method. Is it waitForView()? u r refering to??...

Renas Reda

no leída,
30 ene 2013, 2:28:54 a. m.30/1/13
para Robotium Developers
You can e.g use solo.waitForView(RadioButton.class), if there is a
text string beside the RadioButton you can wait for that instead and
use waitForText(). There are different options depending on how the
app looks.

/Renas

On Jan 30, 6:19 am, Manasa Muchchatti <man...@ninetology.com> wrote:
> No.. bcs i dont see how to use this waitFor method. Is it waitForView()? u
> r refering to??...
>
>
>
>
>
>
>
>
>
> On Tue, Jan 29, 2013 at 8:29 PM, Renas <renasr...@gmail.com> wrote:
> > The reason why I am asking is because of this comment:
>
> > So sometimes click may go wrong(due to slow scrolling.,etc), so can there
> > > be possible to find out which radiobutton clicked
>
> > Have you tried to use any of the waitFor methods before actually clicking
> > on the radiobutton?
>
> > /Renas
>
> > On Tue, Jan 29, 2013 at 2:58 PM, Manasa Muchchatti <man...@ninetology.com>wrote:
>
> >> My testcase is to test Android Profile:
>
> >> 1.If Default is selected then in Manage profiles select wi-fi,data sync.
> >> 2.If Home is selected then in Manage profiles select Bluetooth,alarm
> >> 3.If work is selected then in Manage profiles select ....
>
> >> Like this i have to enable apps,and do some settings change.
>
> >> can we take screen shot and see which radio button is selected or return
> >> a radio buttons value as true if selected.
>
> >> Taking screen shots,i dont like that approach as you have to take screen
> >> shot,compare it,depending on the comparision do stuff... i need a certain
> >> approach like this:
>
> >> if(anyradiobutton==true)
> >>     return indexofthatradiobutton.
>
> >> On Tue, Jan 29, 2013 at 7:17 PM, Renas Reda <renasr...@gmail.com> wrote:
>
> >>> Hi,
>
> >>> Can you please paste your test case?
>
> >>> /Renas
>
> >>> On Jan 28, 8:49 am, Manasa Muchchatti <man...@ninetology.com> wrote:
> >>> > Hi,
>
> >>> > I have to check whether a radio button is clicked or not. Depending on
> >>> this
> >>> > selection my testcases run. If A is selected do 123,if B is selected do
> >>> > 764.... etc.,
>
> >>> > So sometimes click may go wrong(due to slow scrolling.,etc), so can
> >>> there
> >>> > be possible to find out which radiobutton clicked and run its
> >>> > testcases,rather than failing it every time.
>
> >>> > Thanks
>
> >>> --
> >>> You received this message because you are subscribed to the Google
> >>> Groups "Robotium Developers" group.
> >>> To unsubscribe from this group and stop receiving emails from it, send
> >>> an email to robotium-develo...@googlegroups.com.
> >>> To post to this group, send email to
> >>> robotium-...@googlegroups.com.
> >>> Visit this group at
> >>>http://groups.google.com/group/robotium-developers?hl=en.
> >>> For more options, visithttps://groups.google.com/groups/opt_out.
>
> >> --
> >> Thanks and Regards,
> >> Manasa I M
>
> >>  --
> >> You received this message because you are subscribed to the Google Groups
> >> "Robotium Developers" group.
> >> To unsubscribe from this group and stop receiving emails from it, send an
> >> email to robotium-develo...@googlegroups.com.
> >> To post to this group, send email to robotium-...@googlegroups.com
> >> .
> >> Visit this group at
> >>http://groups.google.com/group/robotium-developers?hl=en.
> >> For more options, visithttps://groups.google.com/groups/opt_out.
>
> >  --
> > You received this message because you are subscribed to the Google Groups
> > "Robotium Developers" group.
> > To unsubscribe from this group and stop receiving emails from it, send an
> > email to robotium-develo...@googlegroups.com.
> > To post to this group, send email to robotium-...@googlegroups.com.
> > Visit this group at
> >http://groups.google.com/group/robotium-developers?hl=en.
> > For more options, visithttps://groups.google.com/groups/opt_out.

Manasa Muchchatti

no leída,
30 ene 2013, 2:40:01 a. m.30/1/13
para robotium-...@googlegroups.com
yes.. i can use waitForText(). But can i assert that its been checked actually? I want to know whether touch is occured or not. can that be possible.

For more options, visit https://groups.google.com/groups/opt_out.


Renas

no leída,
30 ene 2013, 2:42:12 a. m.30/1/13
para robotium-...@googlegroups.com
You can by using: solo.isRadioButtonChecked(). But my point is, if you expect it to be clicked then it is important that the test case is set up in a way that it is for sure clicked.

/Renas
Responder a todos
Responder al autor
Reenviar
0 mensajes nuevos