Only a judge may grant a divorce.
If you and your spouse do not agree on all of the issues in your case, you will have to go to court to have the judge decide those matters. Most judges prefer that each party attend any and all settlement/pre-trial conferences set on their case as judges are of the opinion that the parties should be involved in their case and show interest.
There will be opportunities for a partial or complete resolution to settle all of the issues in your case without formal court proceedings. These may include mediation, informal negotiations, and settlement conferences in court, all of which require your appearance.
Depending on the complexity of the issues that cannot be resolved and the amount of evidence that is presented to the court, a trial can last a few hours or several days or even longer.