If $\mathfrak{s}$ is a simple Lie algebra over an algebraically closed field of characteristic zero or a classical simple Lie algebra over an algebraically closed field of characteristic $p>3$. Then the trace over the automorphism group $\operatorname{Aut}(\mathfrak{s})$ is surjective.
Let $\mathfrak{h}$ be a Cartan subalgebra and $\Phi$ its root system, we have the decomposition
$$\mathfrak{s}=\mathfrak{h}\oplus\bigoplus_{\alpha\in\Phi}\mathfrak{s}_\alpha$$
where $\mathfrak{s}_\alpha=\{x\in\mathfrak{s}\vert~ [h,x]=\alpha(h)x\text{ for all }h\in\mathfrak{h}\}$ is of dimension $1$. For a simple root $\alpha_i\in\Delta$, we set $\Lambda_{i}=\{\beta=\sum_{j=1}^l m_j(\beta){\alpha_j}\in\Phi\vert~m_i(\beta)\neq0\}$ and $n_i$ its size. Let $c_i$ be a nonzero scalar, with respect to the Chevalley basis $\{x_\alpha,h_i\vert~\alpha\in\Phi\text{ and }1\leq i\leq\dim\mathfrak{h}\}$, we define the automorphism $\varphi_i$ as follows,
\begin{align*}
\left\{\begin{array}{ll}
\varphi_i(h)=h,&\text{for all } h\in\mathfrak{h},\\
\varphi_i(x_\beta)=c_i^{m_i(\beta)} x_\beta,&\text{for all } \beta=\sum_{j=1}^lm_j(\beta)x_{\alpha_j}.
\end{array}
\right.
\end{align*}
Hence
\begin{align*}
\operatorname{tr}(\varphi_i)&=\dim\mathfrak{h}+\sum_{\beta\in\Delta}c_i^{m_i(\beta)}\\
&=\dim\mathfrak{h}+\vert\Delta\vert-n_i+\sum_{\beta\in\Lambda_i}c_i^{m_i(\beta)}\\
&=\dim\mathfrak{s}-n_i+\sum_{\beta\in\Lambda_i}c_i^{m_i(\beta)}
\end{align*}
Let $\Delta=\{\alpha_1,\cdots,\alpha_l\}$ be a basis of $\Phi$, with the ordering follows Dynkin diagrams in Bourbaki. From Hasse diagrams of poset of positive root systems and by induction, one obtains
$\mathrm{A}_l~(l\geq1)$ : for all $1\leq i\leq l$, $$\operatorname{tr}(\varphi_i)=\dim\mathfrak{s}+i\left(l+1-i\right)\left(c_i+c_i^{-1}-2\right).$$
$\mathrm{B}_l~(l\geq2)$ : for all $1\leq i\leq l$,
\begin{align*}
\operatorname{tr}(\varphi_i)=\dim\mathfrak{s}-i\left(4l+1-3i\right)+i\left(2(l-i)+1\right)\left(c_i+c_i^{-1}\right)+\dfrac{(i-1)i}{2}\left(c_i^2+c_i^{-2}\right).
\end{align*}
$\mathrm{C}_l~(l\geq3)$ : for all $1\leq i\leq l-1$,
\begin{align*}
\left\{
\begin{array}{ll}
\operatorname{tr}(\varphi_i)=\dim\mathfrak{s}-i\left(4l+1-3i\right)+2i\left(l-i\right)\left(c_i+c_i^{-1}\right)+\dfrac{i(i+1)}{2}\left(c_i^2+c_i^{-2}\right),\\
\operatorname{tr}(\varphi_l)=\dim\mathfrak{s}+\dfrac{l(l+1)}{2}\left(c_l+c_l^{-1}-2\right).
\end{array}
\right.
\end{align*}
$\mathrm{D}_l~(l\geq3)$ : for all $1\leq i\leq l-2$,
\begin{align*}
\left\{
\begin{array}{ll}
\operatorname{tr}(\varphi_i)=\dim\mathfrak{s}-i\left(4l-1-3i\right)+2i(l-i)\left(c_i+c_i^{-1}\right)+\dfrac{(i-1)i}{2}\left(c_i^2+c_i^{-2}\right),\\
\operatorname{tr}(\varphi_j)=\dim\mathfrak{s}+\dfrac{(l-1)l}{2}\left(c_j+c_j^{-1}-2\right),~\text{ for }j=l-1\text{ or }l.
\end{array}
\right.
\end{align*}
$\mathrm{E}_6$ :
\begin{align*}
\left\{
\begin{array}{ll}
\operatorname{tr}(\varphi_i)=46+16\left(c_i+c_i^{-1}\right),\text{ for }i=1\text{ or }6,\\
\operatorname{tr}(\varphi_i)=28+20\left(c_i+c_i^{-1}\right)+5\left(c_i^2+c_i^{-2}\right),\text{ for }i=3\text{ or }5,\\
\operatorname{tr}(\varphi_2)=36+20\left(c_2+c_2^{-1}\right)+\left(c_2^2+c_2^{-2}\right),\\
\operatorname{tr}(\varphi_4)=20+18\left(c_4+c_4^{-1}\right)+9\left(c_4^2+c_4^{-2}\right)+2\left(c_4^3+c_4^{-3}\right).
\end{array}
\right.
\end{align*}
$\mathrm{E}_7$ :
\begin{align*}
\left\{
\begin{array}{ll}
\operatorname{tr}(\varphi_1)=67+32\left(c_1+c_1^{-1}\right)+\left(c_1^2+c_1^{-2}\right),\\
\operatorname{tr}(\varphi_2)=49+35\left(c_2+c_2^{-1}\right)+7\left(c_2^2+c_2^{-2}\right),\\
\operatorname{tr}(\varphi_3)=39+30\left(c_3+c_3^{-1}\right)+15\left(c_3^2+c_3^{-2}\right)+2\left(c_3^3+c_3^{-3}\right)\\
\operatorname{tr}(\varphi_4)=27+24\left(c_4+c_4^{-1}\right)+18\left(c_4^2+c_4^{-2}\right)+8\left(c_4^3+c_4^{-3}\right)+3\left(c_4^4+c_4^{-4}\right),\\
\operatorname{tr}(\varphi_5)=33+30\left(c_5+c_5^{-1}\right)+15\left(c_5^2+c_5^{-2}\right)+5\left(c_5^3+c_5^{-3}\right),\\
\operatorname{tr}(\varphi_6)=49+32\left(c_6+c_6^{-1}\right)+10\left(c_6^2+c_6^{-2}\right),\\
\operatorname{tr}(\varphi_7)=79+27\left(c_7+c_7^{-1}\right).
\end{array}
\right.
\end{align*}
$\mathrm{E}_8$ :
\begin{align*}
\left\{
\begin{array}{ll}
\operatorname{tr}(\varphi_1)=&92+64\left(c_1+c_1^{-1}\right)+14\left(c_1^2+c_1^{-2}\right),\\
\operatorname{tr}(\varphi_2)=&64+56\left(c_2+c_2^{-1}\right)+28\left(c_2^2+c_2^{-2}\right)+8\left(c_2^3+c_2^{-3}\right),\\
\operatorname{tr}(\varphi_3)=&52+42\left(c_3+c_3^{-1}\right)+35\left(c_3^2+c_3^{-2}\right)+14\left(c_3^3+c_3^{-3}\right)+7\left(c_3^4+c_3^{-4}\right),\\
\operatorname{tr}(\varphi_4)=&36+30\left(c_4+c_4^{-1}\right)+30\left(c_4^2+c_4^{-2}\right)+20\left(c_4^3+c_4^{-3}\right)\\
&\hspace{.88cm}+15\left(c_4^4+c_4^{-4}\right)+6\left(c_4^5+c_4^{-5}\right)+5\left(c_4^6+c_4^{-6}\right),\\
\operatorname{tr}(\varphi_5)=&40+40\left(c_5+c_5^{-1}\right)+30\left(c_5^2+c_5^{-2}\right)+20\left(c_5^4+c_5^{-3}\right)+10\left(c_5^4+c_5^{-4}\right)+4\left(c_5^5+c_5^{-5}\right),\\
\operatorname{tr}(\varphi_6)=&54+48\left(c_6+c_6^{-1}\right)+30\left(c_6^2+c_6^{-2}\right)+16\left(c_6^3+c_6^{-3}\right)+3\left(c_6^4+c_6^{-4}\right),\\
\operatorname{tr}(\varphi_7)=&82+54\left(c_7+c_7^{-1}\right)+27\left(c_7^2+c_7^{-2}\right)+2\left(c_7^3+c_7^{-3}\right),\\
\operatorname{tr}(\varphi_8)=&134+56\left(c_8+c_8^{-1}\right)+\left(c_8^2+c_8^{-2}\right).
\end{array}
\right.
\end{align*}
$\mathrm{F}_4$ :
\begin{align*}
\left\{
\begin{array}{ll}
\operatorname{tr}(\varphi_1)=22+14\left(c_1+c_1^{-1}\right)+\left(c_1^2+c_1^{-2}\right),\\
\operatorname{tr}(\varphi_2)=12+12\left(c_2+c_2^{-1}\right)+6\left(c_2^2+c_2^{-2}\right)+2\left(c_2^3+c_2^{-3}\right),\\
\operatorname{tr}(\varphi_3)=12+6\left(c_3+c_3^{-1}\right)+9\left(c_3^2+c_3^{-2}\right)+2\left(c_3^3+c_3^{-3}\right)+3\left(c_3^4+c_3^{-4}\right),\\
\operatorname{tr}(\varphi_4)=22+8\left(c_4+c_4^{-1}\right)+7\left(c_4^2+c_4^{-2}\right).
\end{array}
\right.
\end{align*}
$\mathrm{G}_2$ :
\begin{align*}
\left\{
\begin{array}{ll}
\operatorname{tr}(\varphi_1)=4+2\left(c_1+c_1^{-1}\right)+\left(c_1^2+c_1^{-2}\right)+2\left(c_1^3+c_1^{-3}\right),\\
\operatorname{tr}(\varphi_2)=4+4\left(c_2+c_2^{-1}\right)+\left(c_2^2+c_2^{-2}\right).
\end{array}
\right.
\end{align*}