Sign in to follow this  
Followers 0
gavinm

How to verfify tests and output to log

2 posts in this topic

Hello,

I'm a QA that wants to test the verification and opening of links within Outlook emails. I can get autoit to open emails and click links with MouseClick - but how do i know if this is sucessful once the test has completed and I'm not there to verify it?

I would also like to have AutoIt compare two strings and output a sucess/failure result.

so I might expect the title of an email to be in Italian e.g.'È richiesta una tua azione.' and to compare it to an expected result? (being the same string). Does anyone know an easy way to script this so that it goes to a log.

Also trying to output pixelcolour to the text file, again I would prefer to compare with an expected result and get a pass or fail in the output log :graduated:

Have tried this function but cant get the log file to create? the script seems to gloss over or ignore it!

Func WriteLog()

$file = FileOpen("C:\Program Files\AutoIt3\text.txt", 10)

; Check if file opened for reading OK

If $file = -1 Then

MsgBox(0, "Error", "Unable to open file.")

Exit

EndIf

_FileWriteLog("text.txt", $pixelcolor)

FileClose($file)

EndFunc

$pixelcolor = PixelGetColor (611, 252)

_FileWriteLog("text.txt", $pixelcolor)

the reporting of test run results side of AutoitX is pretty poor i must say., bit of a black hole once its kicked off, unless you sit over it.

Anywho, I'll persevere with it. If anyone has any juicy ideas or leads?

Thanks V much

Gavin

Share this post


Link to post
Share on other sites



All functions have return codes or sets @error. You need to create your own error checking.

You're checking for the FileOpen but for the PixelGetColor and _FileWriteLog you are not.

_FileWriteLog will return 0 and set @error to 1 = Error opening specified file 2 = File could not be written to and PixelGetColor will return -1 if it's unable to read the coordinates.

AutoIt does A LOT for error checking, you just need to know how to use it.

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