How to test with a script?

I’m doing a project where I need to execute some tests of the TodoMVC app (through the API). For now I’m just using the web interface, and I’ve tried a lot to execute the following scripted test:

[font=Courier]logData 0
navigate http://todomvc.com/architecture-examples/backbone/
setValue id=new-todo Example task
sendKeyDown id=new-todo ENTER
logData 1
click innerText=Completed[/font]

But the result is always the same:
“The test completed but there were no successful results.”

Here I have a screenshot of the issue. I’ve tried both entering the URL and not in the URL field.

What am I doing wrong?

I’d really appreciate some help, because I’m stuck with this for a few weeks.

Greetings

FWIW, I just manually ran these steps locally using IE8 and, in addition to the page not looking anything like it does under Firefox, it doesn’t respond to the key when the id=“new-todo” field is populated.

On the WebPageTest.org site, Firefox, IE8 and IE10 all either took forever to respond or came back with no results. However, if you enter this as your script:

logData 1
navigate http://todomvc.com/architecture-examples/backbone/
setValue id=new-todo Example task
sendKeyDown id=new-todo ENTER
click innerHTML=Completed

and select IE9 as your browser option it will return results rather quickly. Maybe that will help track down what’s going on. IMPORTANT NOTE: Be sure that your parameters are TAB delimited not spaced.

Hope that helps

Robert

Thanks for your answer, RLilly.

I think that the change you did to the script skips the main interaction I wanted to capture with it (set a value, press ENTER and click a link), because of the “logData 1” sentence at the beginning (at least that’s what I can notice by looking at the screenshot).

I’d like to capture test data after those actions, and I still don’t know how to do it. That’s not all: the real tests I’d like to do are in a mobile environment, but I think that a desktop environment is a good start.

If you want to collect the full sequence then change the logdata 0/1 to be combinesteps. Otherwise WebPagetest will give you quite screwy results if you are trying to measure more than one interaction.

Your last command also needs to be an “andwait” variation, otherwise it’s not going to wait for anything to happen before ending the test.

If you can’t get it to interact with the page in the way you’d like, the easiest fallback is to use the exec command with a chunk of javascript and you can use a local browser console to get the javascript working the way you’d like before submitting it as part of the test.

Thank you so much, Patrick. I can see some results now, after weeks of trying!

Now I have a problem with the ENTER key. I’ve tried with sendKeyDown, sendKeyDownAndWait, sendKeyPress and sendKeyPressAndWait, but it doesn’t seem to be working. The script only reaches the “setValue” sentence (for what I can see in the screenshot). I think I’ll try with some variations, but for now thanks again for your help.

I did a script test run a few weeks ago and it went well (almost all of it was correct), but now, when I try to re-run this test, it takes forever to only show the result: “The test completed but there were no successful results”.

I don’t know why this is happening. The script is the same as before (I just clicked the “Re-run test” button).

Any changes to the scripting tool?

Thanks

No, the script part of the agents haven’t changed in quite a while but Firefox rolled out an update recently (23 I believe). Do you know if the same script works in IE or Chrome?

I’ve just tried with IE 10 and Chrome, and the results are the same. The crazy part is that the script was working a few weeks ago. Weird.