MarkusBernhardt / robotframework-selenium2library-java

Java port of the Selenium 2 (WebDriver) Python library for Robot Framework
Apache License 2.0
46 stars 51 forks source link

Unsupported text/plain, no obvious error message #89

Open eis opened 7 years ago

eis commented 7 years ago

With a simple test:

*** Settings ***
Library           Selenium2Library      3   3   Log Source

*** Variables ***
${BROWSER}  HTMLUnit

*** Test Cases ***
Test example
  Open Browser  http://localhost:8080/  ${BROWSER}
  Page Should Contain  Greetings!
  [Teardown]    Close Browser

You'll get this if content type is text/plain instead of text/html:

Test example                                                                | FAIL |
Page should have contained text 'Greetings!' but did not.

However source logs will tell that text "Greetings!" was found, causing lot of headaches when debugging. No log option seems to indicate any problem with content type.

Test immediately starts to work if content type is set to text/html.

Also note that accept header that is sent is "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8", indicating that text/plain might be supported, when apparently only text/html is supported (?)