We have systematically investigated substrate-strain effects on the electronic structures of two representative Sr-iridates, a correlated-insulator Sr$_2$IrO$_4$ and a metal SrIrO$_3$. Optical conductivities obtained by the emph{ab initio} electronic structure calculations reveal that the tensile strain shifts the optical peak positions to higher energy side with altered intensities, suggesting the enhancement of the electronic correlation and spin-orbit coupling (SOC) strength in Sr-iridates. The response of the electronic structure upon tensile strain is found to be highly correlated with the direction of magnetic moment, the octahedral connectivity, and the SOC strength, which cooperatively determine the robustness of $J_{eff}$=1/2 ground states. Optical responses are analyzed also with microscopic model calculation and compared with corresponding experiments. In the case of SrIrO$_3$, the evolution of the electronic structure near the Fermi level shows high tunability of hole bands, as suggested by previous experiments.