Using IF-ELSE condition

465 views
Skip to first unread message

hari

unread,
Oct 13, 2010, 9:02:56 AM10/13/10
to Marathon Java GUI Testing
Hi ,

I wanted to use IF-ELSE condition in my script and I have given it as
mentioned below:

if window(''):
select_menu('Cashier Operations>>Shift Begin')
close()
else:
Item_Scan_Module.Item_Scan()

where Item_Scan_Module.Item_Scan() is a module I created.

However it is throwing the below mentioned error:

Syntax Error : " mismatched input else expecting DEDENT

Can you please help me to understand where I have gone wrong.

Thank you

Dakshinamurthy Karra

unread,
Oct 14, 2010, 3:00:57 AM10/14/10
to marathon...@googlegroups.com
First of all window() method *never* returns. It is used only to provide indentation to the test script. If Marathon doesn't find a window with the given name, an error will be thrown and the script terminates.

As far as the syntax error goes, please have a look at python documentation.

If it is OK with you, you can use ruby instead of Python for recording tests - in which case you don't need to worry too much about indentation.

Thanks and Regards
KD


--
You received this message because you are subscribed to the Google Groups "Marathon Java GUI Testing" group.
To post to this group, send email to marathon...@googlegroups.com.
To unsubscribe from this group, send email to marathon-testi...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/marathon-testing?hl=en.


Warwick Bambrook

unread,
Oct 19, 2010, 9:34:56 AM10/19/10
to Marathon Java GUI Testing
The documentation is useless and inaccurate, as anyone who has looked
at the -html -xml options on the command line and then looked at the
source will testify.

Are you sure there is a "else:" function?

I have looked and I have been unable to find it!



On Oct 14, 8:00 am, Dakshinamurthy Karra
<dakshinamurthy.ka...@jaliansystems.com> wrote:
> First of all window() method *never* returns. It is used only to provide
> indentation to the test script. If Marathon doesn't find a window with the
> given name, an error will be thrown and the script terminates.
>
> As far as the syntax error goes, please have a look at python documentation.
>
> If it is OK with you, you can use ruby instead of Python for recording tests
> - in which case you don't need to worry too much about indentation.
>
> Thanks and Regards
> KD
>
> On Wed, Oct 13, 2010 at 6:32 PM, hari <hari2...@gmail.com> wrote:
> > Hi ,
>
> > I wanted to use IF-ELSE condition in my script and I have given it as
> > mentioned below:
>
> > if window(''):
> >    select_menu('Cashier Operations>>Shift Begin')
> > close()
> > else:
> >    Item_Scan_Module.Item_Scan()
>
> > where Item_Scan_Module.Item_Scan() is a module I created.
>
> > However it is throwing the below mentioned error:
>
> > Syntax Error : " mismatched input else expecting DEDENT
>
> > Can you please help me to understand where I have gone wrong.
>
> > Thank you
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Marathon Java GUI Testing" group.
> > To post to this group, send email to marathon...@googlegroups.com.
> > To unsubscribe from this group, send email to
> > marathon-testi...@googlegroups.com<marathon-testing%2Bunsu...@googlegroups.com>
> > .

Dakshinamurthy Karra

unread,
Oct 20, 2010, 8:45:01 AM10/20/10
to marathon...@googlegroups.com
Yup. Documentation needs update for 2.0 functionality. It also misses description of some core functionality - checklists, screenshots, semi manual tests etc. We are working on it and update should be available with next release. That said I don't say it is useless - the core functionality of Marathon is same for a long time.

'else:' is  a python keyword.

-- KD


To unsubscribe from this group, send email to marathon-testi...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages