Advertisements

Automating Software Testing Adage ERP, Coolearth Warehouse Management, VeggieTests

So I have been working on an easy VB.net app for submitting QC tests to adage through the TEE interface. As mentioned in this post https://michaelellerbeck.com/2008/04/03/how-to-setup-adage-to-allow-qc_testresults/

Well I wanted to setup an automated test that would basically go from a shop order released to production (In Adage ERP, the lot creation (In Coolearth WMS), and then some sample tests in VeggieTests.

I scripted it in AutoIt, for the windows apps this works great but for the telnet apps it just has to guess. I have started investigating using Expect for the telnet WMS testing.

This is a quick little flash file of one automated run through.

http://sites.google.com/site/mellerbeck/Home/veggieTests.swf?attredirects=0

Advertisements

How to setup Adage to allow QC_TestResults

How to setup Adage to allow QC_TestResults to be passed as an AsynchBarcode transaction.

I wanted to be able to use ATF files to submit QC_TestResults. Here are some of my findings.

In the Adage Explorer, under Applications, there is a barcoding folder. First thing you need to do is change the Lot QC Test Results to use the Transaction Event Engine. (It is possible this is not needed, since it appears to work even if it is not checked.)

To check mark this setting click barcode transaction, then choose Lot QC Test Results, click update, then check Use Transaction Event Engine, then click Update.

If you notice on this screen you can see the format of the Lot QC Test Results.

First is Item, Pack, Lot, – -Test, – -Effective Date, – -Seq Num, – -Operator, – -Test Value, – -Result, – -Status, – -Tested By, – -Tested Date, – -Notes, – -Disposition Code, – -Disposition Comments

These directly relate to the format of the ATF. For example DT_PROMPT1 is Item, DT_PROMPT2 is pack etc…

RECORD_TYPE=PRFX

PRFX_CO_ID=DS

PRFX_EXT_PARTNER=DS

PRFX_DOC_TYPE=AsyncBarcode

PRFX_DOC_NBR=BCI105037

PRFX_TRANS_DIR=I

PRFX_DATE=2008-03-11

PRFX_TIME=10:50:37

PRFX_CONTROL_NBR=1I1205246801BCI105037

RECORD_TYPE=SO_ID

HD_TRANDEF_KEY=30

HD_BCPARAM_CMP=DS <==Company

HD_BRANCH=DSB <==Branch

HD_PLANT=DSP <==Plant

HD_USER=emorris <==User

HD_WHS=DSW <==Warehouse

DT_PROMPT_1=100100 <==Item

DT_PROMPT_2= <==Pack

DT_PROMPT_3=LOTA <==Lot

DT_PROMPT_4=Ecoli <==Test name

DT_PROMPT_5=1/2/1998 <==Test effective date

DT_PROMPT_6=1 <==Test sequence number

DT_PROMPT_7== <== Value is > < or =

DT_PROMPT_8=2 <== Test value

DT_PROMPT_11=emorris <== Tested by

DT_PROMPT_12=03/11/2008 <== Tested date

DT_PROMPT_13=This is a test of notes <== Notes field

DT_PROMPT_14= <== Disposition code

DT_PROMPT_15=Disposition comments <==Disposition comments

DT_PROMPT_16= <== If you were performing more than one test, than this field would contain the next test name.

RECORD_TYPE=ATFSUM

ATFSUM_CHECK=32

In this example from adage they had the test type as HD_TRANDEF_KEY=30

I was getting strange results from that and finally did a search for HD_TRANDEF_KEY what I found was a list of valid Trandefs were contained in bc_trandef_tbl. I found that Lot QC Test Results was actually HD_TRANDEF_KEY=31.

To get a successful test result submitted a few things are absolutely necessary and others are not.

The PRFX_DOC_NBR can be blank; it’s annoying in that it only allows 10 characters.

PRFX_DATE should be in month/day/year format and is required

PRFX_TIME is required.

PRFX_CONTROL_NBR is required and must be unique (stored of course in our favorite ei_queue_tbl)

HD_TRANDEF_KEY=31 (explained above, required)

HD_USER= (must be VALID user)

DT_PROMPT_1=item (required duh)

Items with lots appear to be in en_item_key

DT_PROMPT_2=pack (REQUIRED, if it is blank I believe it is a bulk order)

Packs in en_itqct_tbl

DT_PROMPT_3=lot (required)

Lots with tests attached in qc_specs_lotapproval_testsresult

DT_PROMPT_4=test name (Must Match Exactly)

Tests in QC_Items_specs

DT_PROMPT_5=Test Effective Date (THIS MUST MATCH, otherwise the file will make it into completed but will not update the results)  THIS MUST MATCH DATE AND TIME!

In QC_Items_specs the max(en_itqct_effdt)

DT_PROMPT_6=test sequence number (required, 1)

DT_PROMPT_7= this is the sign, should be < = or > (NOT needed for qualitative)

DT_PROMPT_8= test value (NOT needed for qualitative)

DT_PROMPT_9= this is a free form text field for the ‘result’ up to 256 char

DT_PROMPT_10= this is the status of the qualitative test (REQUIRED for Qualitative)

1 = PASSED

3 = FAILED

DT_PROMPT_11= tested by (haven’t tested whether required or whether needs to be valid user or not)

DT_PROMPT_12= Tested date and time, 4/3/2008 8:07 AM

ATFSUM_CHECK=* (this is valid, with a control line feed after it)

In my case, VeggieTests.exe generates this info as an .XML file

**************XML*************

<AsyncBarcode>

<Prefix>

<CompanyID>NA</CompanyID>

<ExternalPartnerID>NA</ExternalPartnerID>

<DocumentType>AsyncBarcode</DocumentType>

<DocumentNumber>

</DocumentNumber>

<TransactionDirection>I</TransactionDirection>

<DateStamp>4/3/2008</DateStamp>

<TimeStamp>10:35 AM</TimeStamp>

<ControlNumber>04261a1cbdcc6-34bd-43b3-b</ControlNumber>

</Prefix>

<Header00>

<AlternateEntityType>SO_ID</AlternateEntityType>

<TransactionDefinitionKey>31</TransactionDefinitionKey>

<CompanyID0>NA</CompanyID0>

<BranchID>NATL</BranchID>

<UserID>dridgway</UserID>

</Header00>

<Detail01>

<Scanneddata1>FUR99-12030</Scanneddata1>

</Detail01>

<Detail02>

<Scanneddata2>CS20LB</Scanneddata2>

</Detail02>

<Detail03>

<Scanneddata3>04261</Scanneddata3>

</Detail03>

<Detail04>

<Scanneddata4>Aero Rob</Scanneddata4>

</Detail04>

<Detail05>

<Scanneddata5>3/29/2008</Scanneddata5>

</Detail05>

<Detail06>

<Scanneddata6>1</Scanneddata6>

</Detail06>

<Detail07>

<Scanneddata7><</Scanneddata7>

</Detail07>

<Detail08>

<Scanneddata8>5</Scanneddata8>

</Detail08>

<Detail09>

<Scanneddata9>

</Scanneddata9>

</Detail09>

<Detail10>

<Scanneddata10>

</Scanneddata10>

</Detail10>

<Detail11>

<Scanneddata11>dridgway</Scanneddata11>

</Detail11>

<Detail12>

<Scanneddata12>4/3/2008 10:35 AM</Scanneddata12>

</Detail12>

<Detail13>

<Scanneddata13>

</Scanneddata13>

</Detail13>

</AsyncBarcode>

**************XML*************

This is then converted by the TransformTool.jar

With the below script. What it does is take the definition of an AsyncBarcode from c:\AsyncBarcode_Inbound.xsl converts it into an .EIF and moves it to C:\einterface\Inbound\New

**************TransformTool setup file(InputFile.xml)********

<?xml version=”1.0″?>

<!DOCTYPE InputFile SYSTEM “C:\InputFile.dtd”>

<InputFile>

<Directory>

<DirName>c:\QCinput</DirName>

<DirType>.xml</DirType>

<DocTypes>

<DocType>

<DocName>AsyncBarcode</DocName>

<DocTransform>c:\AsyncBarcode_Inbound.xsl</DocTransform>

<NewFile>

<NewFileType>.eif</NewFileType>

<NewFileName>%DocumentType%_%ControlNumber%</NewFileName>

<NewFileDir>C:\einterface\Inbound\New</NewFileDir>

</NewFile>

<SaveOption>

<SaveOptionType>Save</SaveOptionType>

<SaveOptionDir>c:\temp</SaveOptionDir>

</SaveOption>

</DocType>

</DocTypes>

</Directory>

</InputFile>

**************TransformTool setup file(InputFile.xml)********

To test, assuming you have a test set up already (under Application, Enterprise, Quality Management, QC Test)

Next you have to create a specification (QC Specification) that will match your item and pack. And then attach your Test to it.

Now you can attach your specification to your lot. (Lot Specification)

That lot should now go on hold.

Now you can submit your test result ATF files. If everything works right the lot will go off hold.

To view test results go to Lot Test Results and select your Item, Pack, and Lot.

I am going acronym crazy, Implementing Adage ATF files using XML

So our ERP can accept XML files. So I am trying to figure out how to get the X12 doc into the proper XML form. Luckily I have altova mapforce, and I recently just downloaded the trial of Altova XML Spy… I’ll probably end buying it as well, I wonder if they will let me take advantage of their package pricing even though I already bought a single version of Mapforce by itself? Anyways since the ERP provided a DTD (Document Type Definition) I found out that you can use XMLSpy to convert a DTD into an XSD which MapForce can use as an XML structure definition. And right now while typing I just realized that MapForce can also accept DTD file so I will just skip that step.

So now I just need to drag my EDI over to the DTD and tada the import will be complete!

Altova Mapforce is the best!