first commit

This commit is contained in:
s.golasch
2023-08-01 13:11:28 +02:00
commit 7dbc2efe1d
95 changed files with 7441 additions and 0 deletions

13
code/2-session/index.html Normal file
View File

@@ -0,0 +1,13 @@
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title> WebDiver testpage</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body>
<h1>This is a WebDiver testpage</h1>
<script src="webdriver.js"></script>
</body>
</html>

View File

@@ -0,0 +1,30 @@
var getSession = function (cb) {
var request = new XMLHttpRequest();
request.open('POST', 'http://localhost:7020/session', true);
request.setRequestHeader('Content-Type', 'application/json');
request.onload = function() {
cb(null, JSON.parse(request.responseText));
};
request.onerror = function() {
cb(arguments, null);
};
request.send(JSON.stringify({
desiredCapabilities: {
browserName: 'phantomjs',
version: '',
platform: 'ANY'
}
}));
};
getSession(function (err, data) {
var el = document.createElement('div');
var contents = document.createTextNode(JSON.stringify(data));
el.appendChild(contents);
document.getElementsByTagName('body')[0].appendChild(el);
});