When we try, we are usually uncertain as to success; when we attempt, we have always some definite object in view which we seek to accomplish. We may be indifferent as to the result of a trial, but we rarely attempt anything without a desire to succeed.
test is a way of discovering, by questions or practical activities, what someone knows, or what someone or something can do or is like or
a medical examination of part of your body or
an act of using something to find out whether it is working correctly or how effective it is or
a situation which shows how good something is
trial is a synonym of test I believe but the usage depends on the context: trial=legal process, or in Australian English as a mock exam