admc / wd

A node.js client for webdriver/selenium 2.
Other
1.53k stars 402 forks source link

How to retrieve status code? #231

Closed binarykitchen closed 10 years ago

binarykitchen commented 10 years ago

I want to be able to test against 404s within my e2e test scripts.

In the API at https://github.com/admc/wd/blob/master/doc/jsonwire-full-mapping.md I couldn't find anything for that.

Any clues?

sebv commented 10 years ago

It's not possible with Webdriver. See this thread among others.

It's easier to test if you are within an error page using the page content.

binarykitchen commented 10 years ago

I see. Sure I can that by testing its contents. Thanks!

binarykitchen commented 10 years ago

@sebv Can you explain why this is not possible? Really need to be able to test HTTP headers for my e2e tests.

binarykitchen commented 10 years ago

What about https://code.google.com/p/selenium/wiki/JsonWireProtocol#GET_/status ?

sebv commented 10 years ago

This is the selenium server status.

Http header/status are not in the jsonwire protocol, they were considered out of scope.

I think people use this to achieve that: http://testingbot.com/support/other/proxy.

binarykitchen commented 10 years ago

Huh, out of scope? Who says that? HTTP headers might contain very useful information, even for E2E tests. Where can I write suggestions about this?

sebv commented 10 years ago

Selenium. https://code.google.com/p/selenium/issues/detail?id=141

I think it is just the case that it is complex to support all browsers, but case by case is simple, and they didn't have the manpower.

binarykitchen commented 10 years ago

Hmmm, looks like a very long discussion over there :(

sebv commented 10 years ago

Closing, out of scope anyway.