Sign in to follow this  
Followers 0
minnu

GUI Testing automation-logging results

9 posts in this topic

Hi,

I am quite new to GUI testing automation. I have to automate GUI testing (API Testing through GUI).I will get command transfer success or failure child dialog when the API is executed. My doubt is in the verification side.

How can i verify the complete test result fully in a single execution. I want to see the test result. What is conventional method of logging test result in GUI testing automation?

I know its very basic.For a newbie like me , if you can suggest it will be great

Thanks in advance

Minnu

Share this post


Link to post
Share on other sites



I am not totally sure about what you are asking. If you want to log results while the program is still a script, you can use ConsoleWrite(). If it is compiled, ConsoleWrite won't work so you can use MsgBox (as long as there is no time limitations; you will have to click ok on the MsgBox).


[font="Verdana"] [size="2"]"[/size][/font]Failure is not an option -- it comes packaged with Windows"[font="Verdana"][size="2"] Gecko Web Browser[/size][/font][font="Verdana"][size="2"], [/size][/font][font="Verdana"][size="2"]Yahtzee![/size][/font][font="Verdana"][size="2"], Toolbar Launcher (like RocketDock)[/size][/font][font="Verdana"][size="2"]Internet Blocker, Simple Calculator, Local Weather, Easy GDI+ GUI [/size][/font][font="Verdana"][size="2"]Triangle Solver, TCP File Transfer, [/size][/font][font="Verdana"][size="2"]Valuater's Autoit Wrappers[/size][/font][font="Verdana"][size="3"][size="2"][size="2"]OOP In AutoIt[/size][/size][/size][/font][font="Verdana"][size="2"][size="1"]Using Windows XP SP3, 1GB RAM, AMD Athlon Processor @ 2.1 GHzCheck me out at gadgets.freehostrocket.com[/size][/size][/font]

Share this post


Link to post
Share on other sites

I am not totally sure about what you are asking. If you want to log results while the program is still a script, you can use ConsoleWrite(). If it is compiled, ConsoleWrite won't work so you can use MsgBox (as long as there is no time limitations; you will have to click ok on the MsgBox).

Thanks for your reply.

1.I actually want to redirect the output of automated GUI test to a file.

2.Also i want to insert some checkpoints in my automation based on the text of dialog i am getting to decide the API is passed or not

I think many in the forum have experience in the same who can help.Please advise.

Share this post


Link to post
Share on other sites

To export your results to a text document, you can use filewrite(). Since you are new, it may be easier to use _Filewritelog(). Most functions have error codes if something goes wrong. In the help files, you will see the error codes near the return values. Test for errors using:

If @error Then

..............

EndIf

Replace the dots with something like Consolewrite so you can write down the error code. This tests whether the line before this if statement. If there is an error, this statement is run, if not, the statement is skipped.


[font="Verdana"] [size="2"]"[/size][/font]Failure is not an option -- it comes packaged with Windows"[font="Verdana"][size="2"] Gecko Web Browser[/size][/font][font="Verdana"][size="2"], [/size][/font][font="Verdana"][size="2"]Yahtzee![/size][/font][font="Verdana"][size="2"], Toolbar Launcher (like RocketDock)[/size][/font][font="Verdana"][size="2"]Internet Blocker, Simple Calculator, Local Weather, Easy GDI+ GUI [/size][/font][font="Verdana"][size="2"]Triangle Solver, TCP File Transfer, [/size][/font][font="Verdana"][size="2"]Valuater's Autoit Wrappers[/size][/font][font="Verdana"][size="3"][size="2"][size="2"]OOP In AutoIt[/size][/size][/size][/font][font="Verdana"][size="2"][size="1"]Using Windows XP SP3, 1GB RAM, AMD Athlon Processor @ 2.1 GHzCheck me out at gadgets.freehostrocket.com[/size][/size][/font]

Share this post


Link to post
Share on other sites

if @ERROR then _ErrorNotify_ (@ERROR, 'There has been an error')

Func _ErrorNotify_ ($1, $2)
Msgbox (48, $1, $2, '', Wingethandle (Wingettitle ('[active]',''),''))
Filewrite (@SCripdir & '\errorlog.txt', $1 & '---' & $2)
Fileclose (@SCripdir & '\errorlog.txt)
Endfunc

this is what i use for my error checks in my recent scripts

Share this post


Link to post
Share on other sites

Going on from what dantay9 and CodyBarrett said.

This is how you would preformed embedded system testing which I extend to GUI testing. You plan each test with desk checking then write the results a formal log. Something like "Test 008........ Passed". In the code you would have the correct FileWrite commands to do this in if statements. On top of that you will want a log file that has all the 'debug'/other information of your tests like "Start Loading with ID", "Object Loaded, result was foo - expect result was foo" - something like that so you know when things fail. Usually there are different levels of output, Error, Info and Warning. You can great wrapper functions that do this so your logging becomes simpler to do.

You have to plan this as with a similar detail as the planning that goes into making the product you are going to test. Understand that developing a GUI test suit is a mini project in itself, not something that is slapped together.


Post your code because code says more then your words can. SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y. Use Opt("MustDeclareVars", 1)[topic="84960"]Brett F's Learning To Script with AutoIt V3[/topic][topic="21048"]Valuater's AutoIt 1-2-3, Class... is now in Session[/topic]Contribution: [topic="87994"]Get SVN Rev Number[/topic], [topic="93527"]Control Handle under mouse[/topic], [topic="91966"]A Presentation using AutoIt[/topic], [topic="112756"]Log ConsoleWrite output in Scite[/topic]

Share this post


Link to post
Share on other sites

okey thanks

how can i get the text of pop up and compare with a known text.I found functions for other controls.But i don't know how to get the text of pop up?

Share this post


Link to post
Share on other sites

ControlGetText will do it.


Post your code because code says more then your words can. SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y. Use Opt("MustDeclareVars", 1)[topic="84960"]Brett F's Learning To Script with AutoIt V3[/topic][topic="21048"]Valuater's AutoIt 1-2-3, Class... is now in Session[/topic]Contribution: [topic="87994"]Get SVN Rev Number[/topic], [topic="93527"]Control Handle under mouse[/topic], [topic="91966"]A Presentation using AutoIt[/topic], [topic="112756"]Log ConsoleWrite output in Scite[/topic]

Share this post


Link to post
Share on other sites

if its one of YOURS... like you call a Msgbox like the above ones... you will need to have Controlgettext in another script and have the second one runnning the entire time

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0