Webdriver and jQuery Form Validation

364 views
Skip to first unread message

Eric Cope

unread,
Nov 5, 2011, 11:40:58 PM11/5/11
to webdriver
Hello all,
I am trying to use WebDriver to test my web applications web forms. I
am using jQuery's validation-engine to validate on the client side.
However, I can't get webDriver to trigger the necessary jQuery events
to trigger the validation engine to show errors, and block a form
submission in the event of a validation error. What Selenium commands
do I need to trigger those jQuery actions? Do I need custom javascript
to trigger those actions?

Any references are appreciated as well.

Thanks,
Eric Cope

sabf

unread,
Nov 7, 2011, 8:30:21 AM11/7/11
to webd...@googlegroups.com
we use jQuery too.
e.g for an inputfield we use this code to get the validation:
public void getValidationbyTextinput(WebElement FieldId, String Input) {
        FieldId.clear();
        FieldId.sendKeys(Input,Keys.TAB);
        Actions actions = new Actions(driver);
        actions.moveToElement(FieldId).perform();
    }

Eric Cope

unread,
Nov 7, 2011, 10:48:34 PM11/7/11
to webd...@googlegroups.com
Thanks for the help. I have a few questions. Is that Java code below? Do you know the Selenium core commands issued by those methods below?
If you provide a link to the Java library you are using I can dig in to it to figure it out if you don't know off the top of your head.

Thanks,
Eric Cope

--
You received this message because you are subscribed to the Google Groups "webdriver" group.
To view this discussion on the web visit https://groups.google.com/d/msg/webdriver/-/IqI5OoB6ZT4J.
To post to this group, send email to webd...@googlegroups.com.
To unsubscribe from this group, send email to webdriver+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/webdriver?hl=en.

sabf

unread,
Nov 8, 2011, 2:43:00 AM11/8/11
to webd...@googlegroups.com
Yes it is Java code.
I import org.openqa.selenium.interactions.Actions; to use it.

Greetings,
sabf
Reply all
Reply to author
Forward
0 new messages