[ide] gotoIf and label

3,475 views
Skip to first unread message

lavanya kadiyala

unread,
Feb 21, 2011, 8:47:23 AM2/21/11
to Selenium Users
In selenium IDE, I am using the gotoIf

so when the condition is true the control is transferred to the label
and the lines below it are executed. good

when the condition is false it is executing the lines below it..and
also executing the label lines (which should be executed only when
condition is true)

how to specify the start and end points?

condition true:

store 10 x
gotoIf ${x} == 10 target2
echo not match
label target2
echo x matches

log is
# [info] Executing: |store | 10 | x |
# [info] Executing: |gotoIf | ${x} == 10 | target2 |
# [info] Executing: |echo | x matches | |
# [info] echo: x matches


now condition false:
store 10 x
gotoIf ${x} == 9 target2
echo not match
label target2
echo x matches

now log is:
# [info] Executing: |store | 10 | x |
# [info] Executing: |gotoIf | ${x} == 9 | target2 |
# [info] Executing: |echo | not match | |
# [info] echo: not match
# [info] Executing: |label | target2 | |
# [info] Executing: |echo | x matches | |
# [info] echo: x matches

Here after the condition is false the next stmt is executed and also
the label and the statements below the label are executed.

i expected the output will stop at
echo: not match


so how to stop?i mean end of if?

Jayakumar C

unread,
Feb 22, 2011, 3:07:30 AM2/22/11
to seleniu...@googlegroups.com


when the condition is false it is executing the lines below it..and
also executing the label lines (which should be executed only when
condition is true)

 
This skips 'target2' block if condition fails.

store | 10 | x
gotoIf | ${x} == 9 | target2
echo | not match
goto | END
label | target2
echo | x matches
label | END 

--
Jayakumar

kadiyala lavanya

unread,
Feb 22, 2011, 4:27:43 AM2/22/11
to seleniu...@googlegroups.com
Thank you.
i will try this one.

From,
Lavanya



--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To post to this group, send email to seleniu...@googlegroups.com.
To unsubscribe from this group, send email to selenium-user...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/selenium-users?hl=en.

manu kumar

unread,
Feb 23, 2011, 12:10:37 AM2/23/11
to Selenium Users
hi lavanya,
I am new to selenium am using selenium IDE,where you used "gotoIf"
command because
am getting error like unknown command
can you help in this
On Feb 22, 2:27 pm, kadiyala lavanya <kadiyalalava...@gmail.com>
wrote:
> Thank you.
> i will try this one.
>
> From,
> Lavanya
>

kadiyala lavanya

unread,
Feb 23, 2011, 11:02:42 AM2/23/11
to seleniu...@googlegroups.com
see the information in this url:

http://51elliot.blogspot.com/2008/02/selenium-ide-goto.html


there is one file in that. copy that and paste in a notepad and save this file as "goto_sel_ide.js"  and save into your system in C:\Documents and Settings.


now in the selenium ide options, browse that file and click ok.

close selenium ide. close firefox browser.

now open firefox browser and open selenium ide.


now in the command text box type goto 

you will see the commands related to gotoIf



From,
Lavanya

manu kumar

unread,
Feb 23, 2011, 11:50:40 PM2/23/11
to Selenium Users
thank you,
i will try this.

On Feb 23, 9:02 pm, kadiyala lavanya <kadiyalalava...@gmail.com>
wrote:
> see the information in this url:
>
> http://51elliot.blogspot.com/2008/02/selenium-ide-goto.html
>
> there is one file in that. copy that and paste in a notepad and save this
> file as "goto_sel_ide.js"  and save into your system in C:\Documents and
> Settings.
>
> now in the selenium ide options, browse that file and click ok.
>
> close selenium ide. close firefox browser.
>
> now open firefox browser and open selenium ide.
>
> now in the command text box type goto
>
> you will see the commands related to gotoIf
>
> From,
> Lavanya
>
Reply all
Reply to author
Forward
0 new messages