Hi please help i have to find the xpath of this
<button _ngcontent-c27="" aria-label="VALIDATE" color="primary" fxflex="" mat-raised-button="" type="submit" class="mat-raised-button mat-primary" style="flex: 1 1 0%; box-sizing: border-box;"><span class="mat-button-wrapper"> VALIDATE </span><div class="mat-button-ripple mat-ripple" matripple=""></div><div class="mat-button-focus-overlay"></div></button>
but as i copy the xpath
/html/body/app-root/app-side-nav/mat-sidenav-container/mat-sidenav-content/main/app-otp/app-page-container/div/form/div/div/form/div/div[1]/button
then when i use it the console error NoSuchElementException
this is my code in selenium thanks in advace
driver.findElement(By.xpath("/html/body/app-root/app-side-nav/mat-sidenav-container/mat-sidenav-content/main/app-otp/app-page-container/div/form/div/div/form/div/div[1]/button")).click();