Upvote:1
See this answer by Traveler for the better option.
Yes, you can apply for a Schengen tourist visa for taking a written test in Germany. Whether you get one depends on convincing the visa officials that you need to be in Germany for the test and that you will return home after the test, which will not be taken as a given.
As you plan to return to Germany a short time later to study you will not be able to show strong ties to your home country. On top of that comes that a return ticket to Germany is very expensive for just a test.
My advice is to communicate with the university to ask advice, they will have seen the problem more often and may have an alternative for travelling all the way to them for the test. Or they may know how to apply for the right visa.
Upvote:2
The Visum zur Studienbewerbung (student applicant visa) would seem to suit your circumstances and purpose of travel.
If you donβt have a confirmation of admission from your university yet, you should apply for this visa. It will give you three months in Germany to either wait for the confirmation or to apply for further universities, until you get into one of them. It can be extended for another three months, in case you need more time. Once you get admitted, you can apply for a student visa.
Source: https://www.settle-in-berlin.com/germany-visa/student-visa-germany-application/
Instead of the letter of acceptance, you need to provide the proof of application to a study programme and/or proof of correspondence with the university