cameron
cameron

Reputation: 3

Selenium browser detection

Good morning

I have been running a few tests over the past couple of weeks and I have come up against a bit of a wall.

I am testing in IE 7 and 8 and firefox.

Basically my problem is that IE 8 does not yet support a plug in and firefox does not support a referer in a frameset, so basically I want to do is detect which browser I am using and then if its ie 7 run the tests, else skip certain tests, is this possible?

Thanking everyone in advance for their help.

Cheers

Cameron

Upvotes: 0

Views: 1773

Answers (3)

Patrick Lightbody
Patrick Lightbody

Reputation: 4534

Just a note for anyone else who reads this: the question is around using Selenium Core and the solution is designed to edit the HTML-based test suite file. If you're using Selenium RC, you obviously know which browser you launched :)

Upvotes: 1

David Thomas
David Thomas

Reputation: 253318

I might be missing something (probably!) but if all you're trying to do is target tests to IE then would conditional comments work?

<!--[if ie 7]>

    The tests go here.

<![endif]-->

Upvotes: 1

Igor Brejc
Igor Brejc

Reputation: 19004

Hmmm one solution that came up in my mind... maybe it's a little bit odd, but I think it should work: let your Web app. read the HTTP UserAgent and save it as a hidden HTML input field. Then you can access it from your Selenium tests and decide whether you want to continue running them or not.

Maybe there's a better solution, I don't know.

Upvotes: 0

Related Questions