Paul Biggar
Paul Biggar

Reputation: 28739

Prototyping selenium Xpath paths in Firefox

I'm using selenium in my test suite, but since it's slow to set up, I'd like to prototype my xpaths on live pages, rather than waiting for tests to run. Is there a good way to do this?

What's a good solution? Perhaps there's a way to use selenium as a nice REPL directly?

Upvotes: 1

Views: 597

Answers (3)

edA-qa mort-ora-y
edA-qa mort-ora-y

Reputation: 31861

Use the XPather add-on for Firefox. I always use it to check out my XPaths.

Also consider using TestPlan to write your tests. It has Selenium and HTMLUnit as a backend. Since HTMLUnit doesn't open a browser your tests run a lot quicker. Once everything is working with HTMLUnit you can just run in Selenium mode and have the same test work in the browser.

http://testplan.brainbrain.net/

Upvotes: 1

Paul Biggar
Paul Biggar

Reputation: 28739

Firefinder is a nice plugin too, maybe slightly nicer than firebug, maybe not.

Upvotes: 0

Koobz
Koobz

Reputation: 6938

Download the Selenium IDE Firefox plugin. It has what you're looking for and more.

You can enter an xpath, and it'll highlight the resulting elements for you. There's also drop-downs to select the Selenium functions you want to invoke.

It also adds context sensitive entries to your context menu (right click some text, then "AssertEquals" on it for example.)

Upvotes: 2

Related Questions