Here is the line of code that you have to use the before clicking submit and after clicking submit. Then compare they are not matching.
driver.findElement(By.xpath("//span[@class="et_pb_contact_captcha_question"]")).getText();
0
solved Selenium – How to confirm that captcha with two numbers are changed after submit [closed]