tags:

views:

321

answers:

1

I have a number of tests written with YUI Test. YUI Test capabilities when it comes to simulating users' actions are quite limited, or rather fairly low level. For instance, I can't easily simulate the user typing in a text field, with the events and modifications to DOM objects that go with it.

This is something that Selenium does much better, but Selenium is ran in a different way. Is there code in Selenium or some other library that I could call to simulate users' actions, like "type this text in this button", and still keep my test as a YUI Test?

+2  A: 

I don't think you'll be able to keep them as YUI tests. You could somehow import selenium's js libs in your tests and call the methods in browserbot to make those complex actions you say, but I'd prefer to keep things clear and create a selenium test suite properly.

Santi
Are there even Selenium JS files that I can import and use in my YUI tests? I haven't found any documentation about this. If seems that with Selenium you run users' actions from a program that runs outside of the browser and written in Java, Ruby..., and that sends those commands to Selenium running in the browser. But I haven't seen a ways to send those commends from JavaScript running in the browser.
Alessandro Vernet
That's one of the "flavors" in selenium, selenium RC. But in it's core, selenium is built by just javascript.Take a look at the following files, I'd say you should start with selenium-browserbot.jshttp://code.google.com/p/selenium/source/browse/#svn/selenium-core/trunk/src/main/resources/core/scripts
Santi
@Santi, awesome, I will look at the Selenium JS to see if I can call their code to simulate that type of action from my JS code called from YUI Test.
Alessandro Vernet