SlideShare uses cookies to improve functionality and performance, and to provide you with relevant advertising. If you continue browsing the site, you agree to the use of cookies on this website. See our User Agreement and Privacy Policy.
SlideShare uses cookies to improve functionality and performance, and to provide you with relevant advertising. If you continue browsing the site, you agree to the use of cookies on this website. See our Privacy Policy and User Agreement for details.
Successfully reported this slideshow.
Activate your 14 day free trial to unlock unlimited reading.
48.
Set...
//
Instantiate
a
new
wd
session
var
client
=
wd.remote("localhost",
4723);
,
browser
=
client.browser
,
sync
=
client.sync;
49.
sync(function()
{
//
Init
the
browser
browser.init(desired);
Go!
//
Type
into
two
fields
var
fields
=
browser.elementsByTagName('textField');
fields[0].type('2');
fields[1].type('3');
//
Click
a
button
var
buttons
=
browser.elementsByTagName('button');
buttons[0].click();
//
Verify
results
var
texts
=
browser.elementsByTagName('staticText');
assert.equal(browser.text(texts[0]),
5);
//
quite
the
browser
browser.quit();
});