How to get content type?

132 views
Skip to first unread message

TimM

unread,
Dec 15, 2009, 10:55:03 AM12/15/09
to webdriver
Hi guys - I am converting a legacy test framework over to webdriver
and I can do most things but one that has me stumped is how to get the
page content type (e.g. Ctrl-I in firefox - will show if you are using
text/html etc). We had some tests that checked this, and I'm not sure
if I can do this with webdriver.

I thought maybe the manage object might have this info - but I can't
see it?

Tim

Daniel Wagner-Hall

unread,
Dec 15, 2009, 12:31:10 PM12/15/09
to webd...@googlegroups.com
There is currently no way to do this in WebDriver. There may be a way
to work around this - which types are you specifically looking for,
and what do you need to use them for?

David

unread,
Sep 10, 2012, 6:30:07 PM9/10/12
to webdriver
You can do it externally outside Selenium. Like with file downloads.
Extract Selenium cookies for session state if needed, then pass that
to HTTP request library (in your language) then make HTTP call to
request the file. Get the response and check the content-type header
there. This is all done outside Selenium, with only integration point
being passing along Selenium cookies if needed.

On Sep 6, 4:52 am, Johannes Koch <johannes.k...@gmail.com> wrote:
> Hi Daniel,
>
> I would like to know, if a file that is beeing returned is correct the type
> "PDF" or not.
>
> How can I do that?
>
> thanks
> johannes
>
>
>
>
>
>
>
> On Tuesday, December 15, 2009 6:31:10 PM UTC+1, Daniel Wagner-Hall wrote:
>
> > On Tue, Dec 15, 2009 at 3:55 PM, TimM <365...@gmail.com <javascript:>>

Tarun Kumar

unread,
Sep 17, 2012, 1:07:42 AM9/17/12
to webd...@googlegroups.com
Is not it same as - 

<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">

If yes, then it can be read using css/xpath locator?
Reply all
Reply to author
Forward
0 new messages