How can I judge whether a transaction has been charged a fee?

The failed transaction on the test network is still not charged.
Under what circumstances will the failed transaction be charged?
In addition to calculating the balance, is there any other way to know whether a transaction fee has been charged?

To my knowledge Testnet does not have transaction fees activated at this point, neither does Mainnet.
All transactions will be charged, failed or not, all the time, once the fees will be activated.
The amount of gas a TX used is stored on the blockchain and it’s retrievable, but at this point there is no function to estimate the TX fee before send it.