CP-ABE (Bethencourt): How KeyGen computes $D=g^{(\alpha+r)/\beta}$?
Does he calculate $1/\beta$ and computes $D$ as below?
  
  $\qquad D = {(g^\alpha \cdot g^r)}^{1/\beta}$


Yes, that is what he does; as you know, ${(g^\alpha \cdot g^r)}^{1/\beta} = {(g^{\alpha+r})}^{1/\beta} = g^{(\alpha+r)/\beta}$.

He computes $1/\beta$ modulo $p$ (the order of $g$); this can be done by either the extended Euclidean method, or (because $p$ is prime) by using $1/\beta = \beta ^ {p-2}$