How to make Selenium IDE wait for manual user input (Captcha web form)?

11,309 views
Skip to first unread message

maschsee72

unread,
Nov 21, 2011, 4:35:22 AM11/21/11
to Selenium Users
Greetings,

I am using a test suite with some basic test cases recorded with
Selenium IDE for a regular website check. This includes also some test
cases for contact forms. These contact forms inlude a security check
with a Captcha. I would like the test case to stop so that I can enter
the value of the Captcha manually and then click somewhere for this
test case (test suite) to continue.
We cannot deactivate Captchas on the Website.

Thank you for feedback!

Tarun Bhadauria

unread,
Nov 21, 2011, 6:43:26 AM11/21/11
to seleniu...@googlegroups.com
Can you make it constant for your test environment so that Selenium could enter same value each time test is executed.
I would not suggest for manual intervention.

maschsee72

unread,
Nov 24, 2011, 10:58:26 AM11/24/11
to Selenium Users
Unfortuately we cannot change it the way the captcha is always the
same. Is there no command in Selenium that allows to wait for a user
input?

moondog

unread,
Nov 24, 2011, 11:56:05 AM11/24/11
to seleniu...@googlegroups.com
In Java, you could either:
  1. Wait some seconds to give you time to input captcha. It works but if you make errors inserting captcha you might not have enough time to retype it.

    WebDriverWait wait = new WebDriverWait(driver,15); //waits 15 secs

  2. Wait for an element to appear/disappear on the screen: if for example, on successful login an image appears, you could wait until this image is present.
    This should be more reliable and forgiving while typing captcha.

    waiter = new WebDriverWait(driver, 90, 1000);
    waiter.until(new ExpectedCondition<Boolean>(){
                public Boolean apply(WebDriver d) {
                    return (d.findElement(By.id("yourElementID"))!=null);
                }});

Alberto

pyrojonc

unread,
Nov 24, 2011, 11:58:34 AM11/24/11
to Selenium Users
Can you use waitForElementPresent and then wait for an element that
only appears on the page that after the captcha form has been
entered. You could look for an element that is present on success OR
failure and then look specifically for an element that only appears on
failure to log the error and skip the test

Lutfi Dughman

unread,
Nov 24, 2011, 6:42:12 PM11/24/11
to seleniu...@googlegroups.com
here is a trick that might help you a bit, assuming you havent  figured a solution yet:



1- make the script wait for the captcha field to have some text in it: to do this you have to poll the captcha text field every second and see if there is any text in it
2- now its not enought to make sure there is a text, you have to make sure that user is done entering the text manually, to do this 
you need the test to check if the captcha text field has the focus or not.

3- finally if the captcha text field has text in it  AND the captcha field  doesnt have the focus, that means the user finished enetering the captcha value and the script can go on now.


Also, i support Tarun idea of having one captcha for the whole time, ask your developers to make the captcha configurable so in testing environments you have same captcha but in production its changing



--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/selenium-users/-/odZaLDFOUnQJ.

To post to this group, send email to seleniu...@googlegroups.com.
To unsubscribe from this group, send email to selenium-user...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/selenium-users?hl=en.

Emy Jamalian

unread,
Jan 26, 2016, 9:56:58 PM1/26/16
to Selenium Users
my idea is to savev the captcha in the coockies, store the coockie in a variable and type the variable in the box. but this must happen ony in your test environment.

hope this helps
Reply all
Reply to author
Forward
0 new messages