The invention relates to SNP and InDel markers related to a cucumber male sterility gene and a screening method thereof. The cucumber male sterility gene is acquired by screening according to the markers. Specifically, the screening method includes following steps: (1), preparing groups; (2), building a library, and sequencing; (3), adopting bulked segregation analysis (BSA); (4), performing competitive allele specificity PCR (polymerase chain reaction) (KASP), finely mapping a sterility gene, and acquiring SNP or InDel locus in close linkage with sterility character. An effective tool is provided for quick identification of cucumber male sterility plants and efficient production of cucumber hybrid species by acquiring the male sterility gene.