While trying to automate my application, one of the web-page has a toggle button inside a table and I need to select the same. Below is the image of HTML code.I am unable to copy paste the code hence attaching the image.
Below is the code tried but getting error as unable to locate element.
IWebElement btn3 = driver.FindElement(By.XPath("//input[@id='livingExpenseConsent']/ancestor::span"));
Actions action2 = new Actions(driver);
action2.MoveToElement(btn3).Click().Perform();
Kindly suggest the right way to locate the element.

spanwith the slider is not an ancestor. May be is afollowing-siblingbut I don't know if Selenium supports that.