The short answer (detailed answer below)
To get one of the testing FedEx tracking numbers, you can use one of the tracking numbers from the table below (copied from Mock Tracking Numbers for FedEx Express and FedEx Ground) or the number 123456789012.
Note that the FedEx Sandbox environment might be unstable during your testing and you might need to use FedEx API mocks instead (either built in-house using Wiremock or ready-made by a vendor).
Scan Event | Tracking Number | Track By Reference Info. | Shipment Account Number | Ship Date | Destination Postal Code |
---|---|---|---|---|---|
Shipment information sent to FedEx | 449044304137821 | Customer Reference: 115380173Ground Shipment ID: DMWsGWdnNN | 510088000 | 15-08-2020 | 33126 |
Tendered | 149331877648230 | Ground Shipment ID: 149331877648230 | 510088000 | 15-08-2020 | 28752 |
Picked up | 020207021381215 | Ground Shipment ID: 53089528 | 510088000 | 15-08-2020 | 30549 |
Arrived at FedEx location | 403934084723025 | Ground Shipment ID: 403934084723025Department: 31826722 | 510088000 | 15-08-2020 | 99206 |
At local FedEx facility | 920241085725456 | Customer Reference: 0014243047/34684523 Ground Shipment ID: 920241085725456 | 510088000 | 15-08-2020 | 19720 |
At destination sort facility | 568838414941 | Shipper Reference: P218101_004154359Purchase Order: P218101_004154359 | 510088000 | 15-08-2020 | 85388 |
Departed FedEx location | 039813852990618 | Customer Reference: 4631962Ground Shipment ID: THE HOUSEDepartment: McGeePurchase Order: 3385158 | 510088000 | 15-08-2020 | 24740 |
On FedEx vehicle for delivery | 231300687629630 | Customer Reference: W62283340102Ground Shipment ID: 231300687629630Purchase Order: 6228334 | 510088000 | 15-08-2020 | 33126 |
International shipment release | 797806677146 | N/A | |||
Customer not available or business closed (Delivery Exception 007) | 377101283611590 | Ground Shipment ID: 377101283611590 | 510088000 | 15-08-2020 | 95815 |
Local delivery restriction (Delivery Exception 083) | 852426136339213 | Customer Reference: 118402713013 | 510088000 | 15-08-2020 | 11375 |
Incorrect address (Delivery Exception 03) | 797615467620 | Shipper Reference: OTHER-TK104 | 510088000 | 15-08-2020 | 70810 |
Unable to deliver (Shipment Exception 099) | 957794015041323 | N/A | |||
Returned to sender/shipper | 076288115212522 | Invoice: 81909 | 510088000 | 15-08-2020 | 50323 |
Clearance delay (International) | 581190049992 | N/A | |||
Delivered | 122816215025810 | Customer Reference: PO#174724 | 510088000 | 15-08-2020 | 24273 |
Hold at location | 843119172384577 | N/A | |||
Shipment canceled | 070358180009382 | Customer Reference: 15241402Ground Shipment ID: 070358180009382 | 510088000 | 15-08-2020 | 94545 |
Duplicate Tracking Number | 713062653486 | Unique Identifier 1: 2457821000~713062653486~FXUnique Identifier 2: 2457835000~713062653486~FX |
The longer answer
The FedEx Sandbox has numerous stability and test data problems. For example, if you use tracking code 123456789012, you will get a different response status depending on the state of the FedEx Sandbox environment.
If you are performing a one-off manual test of your Magento integration with FedEx API, then using the FedEx Sandbox should be sufficient, and you can go ahead and use one of the codes provided above.
If, however, you are running automated regression or integration tests on a schedule or per commit, then the instability of the environment might cripple your testing. For example, you might see flaky tests and flaky builds and have to spend time investigating them even though there is nothing wrong with your code or tests; it's just an issue with the FedEx Sandbox API.
To resolve the issue with FedEx Sandbox environment stability, you have three options, which are essentially about using test-doubles instead of the real FedEx Sandbox API:
- Create and use mocks in your code instead of using the FedEx Sandbox. For example, Mockito in Java or uniuttest.mock in Python. This means you will have to write the FedEx Mockito mocks yourself. And it comes with several tradeoffs. This is a popular option for developers that have time on their hands and can build solutions internally, and don't work on a tight deadline.
- Create over-the-wire mocks with tools like Wiremock or Mountebank instead of using the FedEx Sandbox. There is a list of tools like that on Wikipedia. The issue here again is that you have to build those over-the-wire mocks yourself, which can be problematic if it's more than one API and you have a lot of work on your plate anyway.
- Use ready-made FedEx API mocks like the one from Traffic Parrot instead of using the FedEx Sandbox. The advantage is that experts create them and can use them within minutes. Just copy their mock API URL and use it instead of the FedEx one. Good idea if you are on a tight deadline. You will have to pay for using them, which can sometimes be a downside of this option.
No comments:
Post a Comment