-
Notifications
You must be signed in to change notification settings - Fork 0
/
webdriversync.html
83 lines (66 loc) · 5.06 KB
/
webdriversync.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8'>
<meta http-equiv="X-UA-Compatible" content="chrome=1">
<link href='https://fonts.googleapis.com/css?family=Chivo:900' rel='stylesheet' type='text/css'>
<link rel="stylesheet" type="text/css" href="stylesheets/stylesheet.css" media="screen">
<link rel="stylesheet" type="text/css" href="stylesheets/pygment_trac.css" media="screen">
<link rel="stylesheet" type="text/css" href="stylesheets/print.css" media="print">
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<title>Testing With Node by NickTulett</title>
</head>
<body>
<div id="container">
<div class="inner">
<header>
<h1>Setting up webdriver-sync</h1>
<h2></h2>
</header>
<!--
<section id="downloads" class="clearfix">
<a href="https://github.com/NickTulett/TestingWithNode/zipball/master" id="download-zip" class="button">
<span>Download .zip</span>
</a>
<a href="https://github.com/NickTulett/TestingWithNode/tarball/master" id="download-tar-gz" class="button">
<span>Download .tar.gz</span>
</a>
<a href="https://github.com/NickTulett/TestingWithNode" id="view-on-github" class="button">
<span>View on GitHub</span>
</a>
</section>
-->
<hr>
<section id="main_content">
<h2>
<a name="using-nodejs-a-an-automated-test-engine" class="anchor" href="#using-nodejs-a-an-automated-test-engine">
<span class="octicon octicon-link"></span>
</a>Setting up webdriver-sync for web testing with node.js</h2>
<h3>What is webdriver-sync?</h3>
<p><a href="http://docs.seleniumhq.org/projects/webdriver/">Webdriver</a> is a product of the <a href="http://docs.seleniumhq.org/">Selenium project</a> which provides an interface to an automation engine embedded in most modern browsers.</p>
<p>There are clients available in various languages to enable you to write scripts for webdriver. <a href="https://github.com/jsdevel/webdriver-sync">Webdriver-sync</a> is a client for node.js that allows scripts to be written in a procedural, synchronous style.</p>
<h3>Installing webdriver-sync</h3>
<p>Webdriver-sync can be installed on Linux, OSX and Windows (note that installation on Windows is initially painful due the dependency on node-java which itself entails installing part of VisualStudio). Instructions are on the linked github page and <a href="http://siva-palakurthi.blogspot.co.uk/2012/12/use-java-in-nodejs.html">here</a> - just be careful about selecting the correct version of each component.</p>
<h3>Using webdriver-sync from node.js</h3>
<p>Webdriver-sync is simply required by your test script, then you run it as a normal node.js CLI application. See the github page for examples.</p>
<h3>Internet Explorer 11</h3>
<p>Make sure "Protected Mode" is enabled for all zones and add your site(s) to the Trustes Sites list.</p>
<h3>Keeping webdriver-sync up to date</h3>
<p>Browser versions change frequently and the corresponding webdriver clients have to keep pace with these changes.</p>
<p>One of the nice things about webdriver-sync is that after the initial install it handles all these dependencies for you. Keep webdriver-sync up to date via npm and it downloads and installs any necessary driver updates for you.</p>
<h3>Webdriver-sync capabilities</h3>
<p>Your webdriver scripts will instantiate a browser then navigate to and interact with websites using selectors and events (just as you would in client-side javascript). You can also execute javascript in the browser at run-time (to parse variables in running code, check response headers, etc). A little bit of trickery will also enable you to test uploads and downloads.</p>
<p>Webdriver is essentially a node.js wrapper around the java client, which is <a href="http://selenium.googlecode.com/git/docs/api/java/index.html?org/openqa/selenium/WebDriver.html">documented here</a>.</p>
<p>Don't worry too much about trying to dig through all that detail. We will be developing a <a href="enhancedScripts.html">DSL</a> to abstract away from the low-level stuff.</p>
<a href="multipleDevices.html">Next: Using multiple OSes and devices</a>
</section>
<footer>
<a href="/TestingWithNode/">Testing With Node</a> is maintained by <a href="https://github.com/NickTulett">NickTulett</a>
<br>This page was generated by <a href="http://pages.github.com">GitHub Pages</a>. Tactile theme by <a href="https://twitter.com/jasonlong">Jason Long</a>.
</footer>
</div>
</div>
</body>
</html>