minnu Posted July 10, 2009 Share Posted July 10, 2009 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 Link to comment Share on other sites More sharing options...
dantay9 Posted July 12, 2009 Share Posted July 12, 2009 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). Link to comment Share on other sites More sharing options...
minnu Posted July 13, 2009 Author Share Posted July 13, 2009 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 notI think many in the forum have experience in the same who can help.Please advise. Link to comment Share on other sites More sharing options...
dantay9 Posted July 13, 2009 Share Posted July 13, 2009 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. Link to comment Share on other sites More sharing options...
CodyBarrett Posted July 13, 2009 Share Posted July 13, 2009 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 [size="1"][font="Tahoma"][COMPLETED]-----[FAILED]-----[ONGOING]VolumeControl|Binary Converter|CPU Usage| Mouse Wrap |WinHide|Word Scrammbler|LOCKER|SCREEN FREEZE|Decisions Decisions|Version UDF|Recast Desktop Mask|TCP Multiclient EXAMPLE|BTCP|LANCR|UDP serverless|AIOCR|OECR|Recast Messenger|AU3C|Tik-Tak-Toe|Snakes & Ladders|BattleShips|TRON|SNAKE_____________________[u]I love the Helpfile it is my best friend.[/u][/font][/size] Link to comment Share on other sites More sharing options...
bo8ster Posted July 14, 2009 Share Posted July 14, 2009 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] Link to comment Share on other sites More sharing options...
minnu Posted July 14, 2009 Author Share Posted July 14, 2009 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? Link to comment Share on other sites More sharing options...
bo8ster Posted July 14, 2009 Share Posted July 14, 2009 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] Link to comment Share on other sites More sharing options...
CodyBarrett Posted July 15, 2009 Share Posted July 15, 2009 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 [size="1"][font="Tahoma"][COMPLETED]-----[FAILED]-----[ONGOING]VolumeControl|Binary Converter|CPU Usage| Mouse Wrap |WinHide|Word Scrammbler|LOCKER|SCREEN FREEZE|Decisions Decisions|Version UDF|Recast Desktop Mask|TCP Multiclient EXAMPLE|BTCP|LANCR|UDP serverless|AIOCR|OECR|Recast Messenger|AU3C|Tik-Tak-Toe|Snakes & Ladders|BattleShips|TRON|SNAKE_____________________[u]I love the Helpfile it is my best friend.[/u][/font][/size] Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now