I am having trouble getting started with the webdriver dart library. I was hoping for some simple examples. I do have the seleniumn server standalone running in the background. I am very new to dart and very experienced with ruby and watir-webdriver.
I was expecting something similar to the code below
import 'package:webdriver/webdriver.dart';
main() {
var url = "http://google.com";
var driver = new WebDriver();
b = driver.newSession(browser:'firefox');
b.getUrl(url);
}
But the error I am getting is
Unhandled exception:
No constructor 'WebDriver' declared in class 'WebDriver'.
Looking at the source
class WebDriver extends WebDriverBase {
WebDriver(host, port, path) : super(host, port, path);
So it seems like the constructor is there; and the defaults are in the WebDriverBase to go to the remote server. What am I doing wrong? I have scoured the internet trying to find simple examples with no luck
import 'package:webdriver/webdriver.dart';main() {var driver = new WebDriver('localhost',4444,'/wd/hub').newSession('firefox');driver.setUrl('http://google.com');// driver is Instance of '_FutureImpl@0x2900bd4a'// instead of WebDriverSession// "Future<WebDriverSession>" has no method named "setUrl"}