Can we get how many window when running testcase

Is there any way to calculate how many window in when running testcase ?
i need to do decision step , here is the flow
if window handles more than 0 {
//code
} else if window handles == 1 {
//code
}

anyone know the solution pls answer my question :slight_smile: thank you