how to check the two condition to captcha. First,captcha is blank and second,captcha take the wrong captcha value. How to check captcha if or elseif condition. So please give me a Answer.

If any one solve this problem. So submit this answer.

Default Asked on November 11, 2014 in Selenium WebDriver.
Add Comment
  • 2 Answer(s)

    If you’re sure that you can get hold of the captcha, then you can try the below code.

    String captcha=”xxxx”
    if(driver.findElement(By.xpath(your captcha webelement1).contains(“”)
    &&(driver.findElementByxpath(your captcha webelement2).contains(captcha)){
    do this
    }
    else{
    do this
    }

    Doctor Answered on November 11, 2014.
    Add Comment

    if I have hold the error message use if() else condition ..
    just like
    if (error message)
    {
    then do
    }
    else
    {
    then do
    }
    but this is not running simple.

    Default Answered on November 13, 2014.
    Add Comment
  • Your Answer

    By posting your answer, you agree to the privacy policy and terms of service.