jonhoo / fantoccini

A high-level API for programmatically interacting with web pages through WebDriver.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

returning Prototype.Array shows in console.log but nothing from println.

davehorner opened this issue · comments

    let ret=client.execute("
    console.log(parent.someOperation().map(x => x.Prop()));
    return parent.someOperation().map(x => x.Prop());
    ",Vec::new()).await?;
        println!("chrome: {}",ret.as_str().unwrap_or(""));

I see the data in the chrome debugger after I click the [{...}] icon. I only see empty "result:" lines from then fantoccini Json value returned.

Hmm, this could be all sorts of things. I don't think is a bug in fantoccini. It might be a race condition in the code where the value is empty by time you get to the return. It might be that the value is empty at the time of the return, but by the time you look at the console it has resolve. Next thing to do would probably be to enable debug/verbose mode in your WebDriver to see what actually goes over the wire.