https://kotlinlang.org logo
#http4k
Title
# http4k
r

Razvan

10/16/2020, 8:01 AM
A coworkorker run this test using webdriver on windows:
Copy code
@Test
    fun index() {
        val app = routes(
            "/hello" bind Method.GET to {
                Response(OK).body("<html><title>hello</title></html>")
            }
        )
        val driver = Http4kWebDriver(app)

        driver.navigate().to("<http://localhost:10000/hello>")

        println(driver.title)
        println(driver.currentUrl)
        println(driver.findElement(By.tagName("title")))
    }
and gets as result
Copy code
<http://localhost:10000/>\hello
null
I run it on Linux all is OK
Copy code
hello
<http://localhost:10000/hello>
JSoupWebElement(navigate=fun org.http4k.webdriver.Http4kWebDriver.navigateTo(org.http4k.core.Request): kotlin.Unit, getURL=() -> kotlin.String?, element=<title>hello</title>)
Any ideea where that comes from?
d

dave

10/16/2020, 8:05 AM
sorry - no clue. It's also fine on OSX. Don't have access to a windows box to test it...
r

Razvan

10/16/2020, 8:27 AM
Looks like something in
Http4kWebDriver.normalized()
as you use java Path to extact the path, Also no windows so have to do in pair with the mate... I'll let you know if we find the place.
Yes is exactly that on widows:
Copy code
Path.get("/hello") returns "\hello"
3 Views