You can find radio buttonwith the help of By.xpaththe text your tags, as shown below: -
To click the switch with label text Frau:
driver.findElement(By.xpath("//input[../following-sibling::label[contains(.,'Frau')]]")).click();
To click the switch with label text Herr:
driver.findElement(By.xpath("//input[../following-sibling::label[contains(.,'Herr')]]")).click();
: - , , WebDriverWait, , DOM, : -
WebDriverWait wait = new WebDriverWait(driver, 10);
el = wait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath("//input[../following-sibling::label[contains(.,'Herr')]]")));
el.click();
, JavascriptExecutor, : -
((JavascriptExecutor)driver).executeScript("arguments[0].click()", el);