WebdriverIO giving errors when trying to run tests - webdriver-io

I'm having problems running my WebdriverIO tests and I think it's to do with how I'm handling running behind a corporate proxy. Things used to work fine but suddenly they have stopped and after a few hours trying various things I've run out of ideas.
My proxy details are saved as windows system variables in the name of http_proxy and https_proxy. I haven't changed these. The format I'm using for a variable is like this - http://myusername:mypassword#myproxyaddress:8080.
I also get errors when connecting to the internet through an external connection so I'm not 100% its the proxy causing this.
I've tried update all my packages so my package file now looks like this:
{
"name": "name",
"version": "1.0.0",
"description": "UI Tests",
"main": "index.js",
"scripts": {
"test": "node_modules/.bin/wdio ./wdio.conf.js"
},
"author": "Matt Thomas",
"license": "ISC",
"devDependencies": {
"#wdio/dot-reporter": "^5.18.6",
"#wdio/local-runner": "^5.18.6",
"#wdio/mocha-framework": "^5.18.6",
"#wdio/selenium-standalone-service": "^5.16.10",
"#wdio/spec-reporter": "^5.18.6",
"#wdio/sync": "^5.18.6",
"chai": "^4.2.0",
"chai-webdriverio": "^1.0.0",
"chromedriver": "^79.0.3",
"local-runner": "^0.1.1-alpha",
"wdio-chromedriver-service": "^5.0.2",
"webdriver": "^5.18.6"
},
"dependencies": {
"#wdio/cli": "^5.18.6"
}
}
My wdio.conf.js file is here(comments stripped out from actual file):
exports.config = {
specs: [
'./test/**/*.js'
],
// Patterns to exclude.
exclude: [
// 'path/to/excluded/files'
],
maxInstances: 10,
capabilities: [{
maxInstances: 5,
browserName: 'chrome'
}],
logLevel: 'trace',
bail: 0,
baseUrl: 'https://apps-dev.bhp.com/moc/',
waitforTimeout: 15000,
connectionRetryTimeout: 90000,
connectionRetryCount: 3,
services: ['chromedriver','selenium-standalone'],
framework: 'mocha',
reporters: ['spec','dot'],
mochaOpts: {
ui: 'bdd',
timeout: 120000
},
beforeTest: function (test, context) {
const chai = require('chai')
const chaiWebdriver = require('chai-webdriverio').default
chai.use(chaiWebdriver(browser))
global.assert = chai.assert
global.should = chai.should
global.expect = chai.expect
},
}
And my terminal when i run the test:
PS C:\Test Automation\Projects\WebdriveriO\GlobalMoC> npm test -- --spec ./test/login.test.js
> globalmoc#1.0.0 test C:\Test Automation\Projects\WebdriveriO\GlobalMoC
> wdio ./wdio.conf.js "--spec" "./test/login.test.js"
Execution of 1 spec files started at 2020-02-14T00:54:12.038Z
2020-02-14T00:54:12.042Z DEBUG #wdio/utils:initialiseServices: initialise wdio service "chromedriver"
2020-02-14T00:54:12.131Z DEBUG #wdio/utils:initialiseServices: initialise wdio service "selenium-standalone"
2020-02-14T00:54:12.204Z INFO #wdio/cli:launcher: Run onPrepare hook
Starting ChromeDriver 79.0.3945.36 (3582db32b33893869b8c1339e8f4d9ed1816f143-refs/branch-heads/3945#{#614}) on port 4444
Only local connections are allowed.
Please protect ports used by ChromeDriver and related test frameworks to prevent access by malicious code.
2020-02-14T00:54:12.793Z ERROR #wdio/cli:utils: A service failed in the 'onPrepare' hook
Error: Could not download https://selenium-release.storage.googleapis.com/3.14/IEDriverServer_Win32_3.14.0.zip: Error: unable to get local issuer certificate
at Request.<anonymous> (C:\Test Automation\Projects\WebdriveriO\GlobalMoC\node_modules\selenium-standalone\lib\install.js:387:12)
at Object.onceWrapper (events.js:286:20)
at Request.emit (events.js:198:13)
at Request.EventEmitter.emit (domain.js:448:20)
at Request.onRequestError (C:\Test Automation\Projects\WebdriveriO\GlobalMoC\node_modules\request\request.js:881:8)
at ClientRequest.emit (events.js:198:13)
at ClientRequest.EventEmitter.emit (domain.js:448:20)
at TLSSocket.socketErrorListener (_http_client.js:392:9)
at TLSSocket.emit (events.js:198:13)
at TLSSocket.EventEmitter.emit (domain.js:448:20)
Continue...
2020-02-14T00:54:12.831Z INFO #wdio/local-runner: Start worker 0-0 with arg: ./wdio.conf.js,--spec,./test/login.test.js
[0-0] 2020-02-14T00:54:14.120Z INFO #wdio/local-runner: Run worker command: run
[0-0] RUNNING in chrome - C:\Test Automation\Projects\WebdriveriO\GlobalMoC\test\login.test.js
[0-0] 2020-02-14T00:54:14.473Z DEBUG #wdio/local-runner:utils: init remote session
[0-0] 2020-02-14T00:54:14.477Z INFO webdriverio: Initiate new session using the webdriver protocol
2020-02-14T00:54:14.481Z INFO webdriver: [POST] http://127.0.0.1:4444/session
2020-02-14T00:54:14.482Z INFO webdriver: DATA { capabilities:
{ alwaysMatch: { browserName: 'chrome' }, firstMatch: [ {} ] },
desiredCapabilities: { browserName: 'chrome' } }
[0-0] 2020-02-14T00:54:14.629Z DEBUG webdriver: request failed due to missing body
[0-0] 2020-02-14T00:54:14.630Z WARN webdriver: Request failed due to <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/>
<title>406 - Client browser does not accept the MIME type of the requested page.</title>
<style type="text/css">
<!--
body{margin:0;font-size:.7em;font-family:Verdana, Arial, Helvetica, sans-serif;background:#EEEEEE;}
fieldset{padding:0 15px 10px 15px;}
h1{font-size:2.4em;margin:0;color:#FFF;}
h2{font-size:1.7em;margin:0;color:#CC0000;}
h3{font-size:1.2em;margin:10px 0 0 0;color:#000000;}
#header{width:96%;margin:0 0 0 0;padding:6px 2% 6px 2%;font-family:"trebuchet MS", Verdana, sans-serif;color:#FFF;
background-color:#555555;}
#content{margin:0 0 0 2%;position:relative;}
.content-container{background:#FFF;width:96%;margin-top:8px;padding:10px;position:relative;}
-->
</style>
</head>
<body>
<div id="header"><h1>Server Error</h1></div>
<div id="content">
<div class="content-container"><fieldset>
<h2>406 - Client browser does not accept the MIME type of the requested page.</h2>
<h3>The page you are looking for cannot be opened by your browser because it has a file name extension that your browser does not accept.</h3>
</fieldset></div>
</div>
</body>
</html>
[0-0] 2020-02-14T00:54:14.630Z INFO webdriver: Retrying 1/3
2020-02-14T00:54:14.630Z INFO webdriver: [POST] http://127.0.0.1:4444/session
2020-02-14T00:54:14.630Z INFO webdriver: DATA { capabilities:
{ alwaysMatch: { browserName: 'chrome' }, firstMatch: [ {} ] },
desiredCapabilities: { browserName: 'chrome' } }
2020-02-14T00:54:14.661Z DEBUG webdriver: request failed due to missing body
2020-02-14T00:54:14.661Z INFO webdriver: Retrying 2/3
2020-02-14T00:54:14.661Z INFO webdriver: [POST] http://127.0.0.1:4444/session
2020-02-14T00:54:14.661Z INFO webdriver: DATA { capabilities:
{ alwaysMatch: { browserName: 'chrome' }, firstMatch: [ {} ] },
desiredCapabilities: { browserName: 'chrome' } }
[0-0] 2020-02-14T00:54:14.661Z WARN webdriver: Request failed due to <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/>
<title>406 - Client browser does not accept the MIME type of the requested page.</title>
<style type="text/css">
<!--
body{margin:0;font-size:.7em;font-family:Verdana, Arial, Helvetica, sans-serif;background:#EEEEEE;}
fieldset{padding:0 15px 10px 15px;}
h1{font-size:2.4em;margin:0;color:#FFF;}
h2{font-size:1.7em;margin:0;color:#CC0000;}
h3{font-size:1.2em;margin:10px 0 0 0;color:#000000;}
#header{width:96%;margin:0 0 0 0;padding:6px 2% 6px 2%;font-family:"trebuchet MS", Verdana, sans-serif;color:#FFF;
background-color:#555555;}
#content{margin:0 0 0 2%;position:relative;}
.content-container{background:#FFF;width:96%;margin-top:8px;padding:10px;position:relative;}
-->
</style>
</head>
<body>
<div id="header"><h1>Server Error</h1></div>
<div id="content">
<div class="content-container"><fieldset>
<h2>406 - Client browser does not accept the MIME type of the requested page.</h2>
<h3>The page you are looking for cannot be opened by your browser because it has a file name extension that your browser does not accept.</h3>
</fieldset></div>
</div>
</body>
</html>
2020-02-14T00:54:14.691Z WARN webdriver: Request failed due to <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/>
<title>406 - Client browser does not accept the MIME type of the requested page.</title>
<style type="text/css">
<!--
body{margin:0;font-size:.7em;font-family:Verdana, Arial, Helvetica, sans-serif;background:#EEEEEE;}
fieldset{padding:0 15px 10px 15px;}
h1{font-size:2.4em;margin:0;color:#FFF;}
h2{font-size:1.7em;margin:0;color:#CC0000;}
h3{font-size:1.2em;margin:10px 0 0 0;color:#000000;}
#header{width:96%;margin:0 0 0 0;padding:6px 2% 6px 2%;font-family:"trebuchet MS", Verdana, sans-serif;color:#FFF;
background-color:#555555;}
#content{margin:0 0 0 2%;position:relative;}
.content-container{background:#FFF;width:96%;margin-top:8px;padding:10px;position:relative;}
-->
</style>
</head>
<body>
<div id="header"><h1>Server Error</h1></div>
<div id="content">
<div class="content-container"><fieldset>
<h2>406 - Client browser does not accept the MIME type of the requested page.</h2>
<h3>The page you are looking for cannot be opened by your browser because it has a file name extension that your browser does not accept.</h3>
</fieldset></div>
</div>
</body>
</html>
2020-02-14T00:54:14.722Z ERROR webdriver: Request failed due to Error: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/>
<title>406 - Client browser does not accept the MIME type of the requested page.</title>
<style type="text/css">
<!--
body{margin:0;font-size:.7em;font-family:Verdana, Arial, Helvetica, sans-serif;background:#EEEEEE;}
fieldset{padding:0 15px 10px 15px;}
h1{font-size:2.4em;margin:0;color:#FFF;}
h2{font-size:1.7em;margin:0;color:#CC0000;}
h3{font-size:1.2em;margin:10px 0 0 0;color:#000000;}
#header{width:96%;margin:0 0 0 0;padding:6px 2% 6px 2%;font-family:"trebuchet MS", Verdana, sans-serif;color:#FFF;
background-color:#555555;}
#content{margin:0 0 0 2%;position:relative;}
.content-container{background:#FFF;width:96%;margin-top:8px;padding:10px;position:relative;}
-->
</style>
</head>
<body>
<div id="header"><h1>Server Error</h1></div>
<div id="content">
<div class="content-container"><fieldset>
<h2>406 - Client browser does not accept the MIME type of the requested page.</h2>
<h3>The page you are looking for cannot be opened by your browser because it has a file name extension that your browser does not accept.</h3>
</fieldset></div>
</div>
</body>
</html>
at getErrorFromResponseBody (C:\Test Automation\Projects\WebdriveriO\GlobalMoC\node_modules\webdriver\build\utils.js:117:12)
at Request._callback (C:\Test Automation\Projects\WebdriveriO\GlobalMoC\node_modules\webdriver\build\request.js:111:64)
at Request.self.callback (C:\Test Automation\Projects\WebdriveriO\GlobalMoC\node_modules\request\request.js:185:22)
at Request.emit (events.js:198:13)
at Request.EventEmitter.emit (domain.js:448:20)
at Request.<anonymous> (C:\Test Automation\Projects\WebdriveriO\GlobalMoC\node_modules\request\request.js:1161:10)
at Request.emit (events.js:198:13)
at Request.EventEmitter.emit (domain.js:448:20)
at IncomingMessage.<anonymous> (C:\Test Automation\Projects\WebdriveriO\GlobalMoC\node_modules\request\request.js:1083:12)
at Object.onceWrapper (events.js:286:20)
2020-02-14T00:54:14.723Z ERROR webdriver: Error: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/>
<title>406 - Client browser does not accept the MIME type of the requested page.</title>
<style type="text/css">
<!--
body{margin:0;font-size:.7em;font-family:Verdana, Arial, Helvetica, sans-serif;background:#EEEEEE;}
fieldset{padding:0 15px 10px 15px;}
h1{font-size:2.4em;margin:0;color:#FFF;}
h2{font-size:1.7em;margin:0;color:#CC0000;}
h3{font-size:1.2em;margin:10px 0 0 0;color:#000000;}
#header{width:96%;margin:0 0 0 0;padding:6px 2% 6px 2%;font-family:"trebuchet MS", Verdana, sans-serif;color:#FFF;
background-color:#555555;}
#content{margin:0 0 0 2%;position:relative;}
.content-container{background:#FFF;width:96%;margin-top:8px;padding:10px;position:relative;}
-->
</style>
</head>
<body>
<div id="header"><h1>Server Error</h1></div>
<div id="content">
<div class="content-container"><fieldset>
<h2>406 - Client browser does not accept the MIME type of the requested page.</h2>
<h3>The page you are looking for cannot be opened by your browser because it has a file name extension that your browser does not accept.</h3>
</fieldset></div>
</div>
</body>
</html>
at getErrorFromResponseBody (C:\Test Automation\Projects\WebdriveriO\GlobalMoC\node_modules\webdriver\build\utils.js:117:12)
at Request._callback (C:\Test Automation\Projects\WebdriveriO\GlobalMoC\node_modules\webdriver\build\request.js:111:64)
at Request.self.callback (C:\Test Automation\Projects\WebdriveriO\GlobalMoC\node_modules\request\request.js:185:22)
at Request.emit (events.js:198:13)
at Request.EventEmitter.emit (domain.js:448:20)
at Request.<anonymous> (C:\Test Automation\Projects\WebdriveriO\GlobalMoC\node_modules\request\request.js:1161:10)
at Request.emit (events.js:198:13)
at Request.EventEmitter.emit (domain.js:448:20)
at IncomingMessage.<anonymous> (C:\Test Automation\Projects\WebdriveriO\GlobalMoC\node_modules\request\request.js:1083:12)
at Object.onceWrapper (events.js:286:20)
2020-02-14T00:54:14.724Z ERROR #wdio/runner: Error: Failed to create session.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/>
<title>406 - Client browser does not accept the MIME type of the requested page.</title>
<style type="text/css">
<!--
body{margin:0;font-size:.7em;font-family:Verdana, Arial, Helvetica, sans-serif;background:#EEEEEE;}
fieldset{padding:0 15px 10px 15px;}
h1{font-size:2.4em;margin:0;color:#FFF;}
h2{font-size:1.7em;margin:0;color:#CC0000;}
h3{font-size:1.2em;margin:10px 0 0 0;color:#000000;}
#header{width:96%;margin:0 0 0 0;padding:6px 2% 6px 2%;font-family:"trebuchet MS", Verdana, sans-serif;color:#FFF;
background-color:#555555;}
#content{margin:0 0 0 2%;position:relative;}
.content-container{background:#FFF;width:96%;margin-top:8px;padding:10px;position:relative;}
-->
</style>
</head>
<body>
<div id="header"><h1>Server Error</h1></div>
<div id="content">
<div class="content-container"><fieldset>
<h2>406 - Client browser does not accept the MIME type of the requested page.</h2>
<h3>The page you are looking for cannot be opened by your browser because it has a file name extension that your browser does not accept.</h3>
</fieldset></div>
</div>
</body>
</html>
at startWebDriverSession (C:\Test Automation\Projects\WebdriveriO\GlobalMoC\node_modules\webdriver\build\utils.js:45:11)
at process._tickCallback (internal/process/next_tick.js:68:7)
[0-0] Error: Failed to create session.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/>
<title>406 - Client browser does not accept the MIME type of the requested page.</title>
<style type="text/css">
<!--
body{margin:0;font-size:.7em;font-family:Verdana, Arial, Helvetica, sans-serif;background:#EEEEEE;}
fieldset{padding:0 15px 10px 15px;}
h1{font-size:2.4em;margin:0;color:#FFF;}
h2{font-size:1.7em;margin:0;color:#CC0000;}
h3{font-size:1.2em;margin:10px 0 0 0;color:#000000;}
#header{width:96%;margin:0 0 0 0;padding:6px 2% 6px 2%;font-family:"trebuchet MS", Verdana, sans-serif;color:#FFF;
background-color:#555555;}
#content{margin:0 0 0 2%;position:relative;}
.content-container{background:#FFF;width:96%;margin-top:8px;padding:10px;position:relative;}
-->
</style>
</head>
<body>
<div id="header"><h1>Server Error</h1></div>
<div id="content">
<div class="content-container"><fieldset>
<h2>406 - Client browser does not accept the MIME type of the requested page.</h2>
<h3>The page you are looking for cannot be opened by your browser because it has a file name extension that your browser does not accept.</h3>
</fieldset></div>
</div>
</body>
</html>
[0-0] 2020-02-14T00:54:14.691Z DEBUG webdriver: request failed due to missing body
2020-02-14T00:54:14.691Z INFO webdriver: Retrying 3/3
2020-02-14T00:54:14.691Z INFO webdriver: [POST] http://127.0.0.1:4444/session
2020-02-14T00:54:14.692Z INFO webdriver: DATA { capabilities:
{ alwaysMatch: { browserName: 'chrome' }, firstMatch: [ {} ] },
desiredCapabilities: { browserName: 'chrome' } }
2020-02-14T00:54:14.722Z DEBUG webdriver: request failed due to missing body
2020-02-14T00:54:15.284Z DEBUG #wdio/local-runner: Runner 0-0 finished with exit code 1
[0-0] FAILED in chrome - C:\Test Automation\Projects\WebdriveriO\GlobalMoC\test\login.test.js
2020-02-14T00:54:15.302Z INFO #wdio/cli:launcher: Run onComplete hook
Spec Files: 0 passed, 1 failed, 1 total (100% completed) in 00:00:03
2020-02-14T00:54:15.306Z INFO #wdio/local-runner: Shutting down spawned worker
2020-02-14T00:54:15.569Z INFO #wdio/local-runner: Waiting for 0 to shut down gracefully
2020-02-14T00:54:15.578Z INFO #wdio/local-runner: shutting down
npm ERR! Test failed. See above for more details.

Since you are trying to use selenium standalone service and behind a proxy, you should include below settings in your config file. This is working for me. I have included some documents you can refer to.
skipSeleniumInstall: false,
seleniumInstallArgs: {
requestOpts: {
strictSSL: false,
timeout: 10000,
proxy: proxyurl,
},
},
https://webdriver.io/docs/selenium-standalone-service.html#skipseleniuminstall
WebdriverIO: How to fix error "unknown error: cannot get automation extension"?
Cheers!

Related

No showing ads in videos in desktop

This is my html Code: the video is playing but no ads are shown. Please tell me what is wrong with this code. I got this code from videojs website for streaming my videos. I am not experienced in Javascript. Please support. Thanks in advance.
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Video.js VAST Example</title>
<link href="videojs/video-js.css" rel="stylesheet">
<link href="vast/lib/videojs-contrib-ads/videojs.ads.css" rel="stylesheet" type="text/css">
<link href="vast/videojs.vast.css" rel="stylesheet" type="text/css">
<style type="text/css">
.description {
background-color:#eee;
border: 1px solid #777;
padding: 10px;
font-size: .8em;
line-height: 1.5em;
font-family: Verdana, sans-serif;
}
.example-video-container {
display: inline-block;
}
</style>
<!--[if lt IE 9]><script src="lib/es5.js"></script><![endif]-->
<script src="videojs/video.js"></script>
<script src="vast/lib/videojs-contrib-ads/videojs.ads.js"></script>
<script src="vast/lib/vast-client.js"></script>
<script src="vast/videojs.vast.js"></script>
</head>
<body>
<p class="description">Video.js VAST plugin examples.</p>
<div class="example-video-container">
<p class="description">With autoplay.</p>
<video id="vid1" class="video-js vjs-default-skin" autoplay controls preload="auto"
poster="images/nisshabdam.jpg"
data-setup='{}'
width='640'
height='400'
>
<source src="myfilm.m3u8" type="application/x-mpegURL" />
<p>Video Playback Not Supported</p>
</video>
</div>
<script>
var vid1 = videojs('vid1');
vid1.muted(true);
vid1.ads(),
vid1.vast({
url: 'https://www.videosprofitnetwork.com/watch.xml?key=1760'
});
</script>
</body>
</html>
When I go to your VAST URL:
https://www.videosprofitnetwork.com/watch.xml?key=1760
...I get a 403 HTTP error. That's probably the reason. You can ask your video ad network to get a working tag. Note that not all advertisers may want to advertise on your website, so you may not get an ad on every page view.

Magnific Popup AutoLoad on Page Loading... Not Working

I installed this code on a single page PHP page and it works the way I want it to. Problem is page I need to install it on is broken up into 4 PHP pages.(Home.php, which also includes, Header, Menu, and Footer PHP pages...) and I can't get the code to work. I've tried installing it different places but no luck... if anyone can help would be much appreciated... Code is below.
page to install on is: http://tonysatthejhouse.com THANKS!!
<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<title>Untitled Document</title>
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/magnific-popup.js/1.1.0/magnific-popup.css" />
<link rel="stylesheet" href="http://tonysatthejhouse.com/superadmin/assets/css/Mag3.css" />
</head>
<body>
<h1>THIS IS A TEST</h1>
<script data-require="jquery#1.9.1" data-semver="1.9.1" src="https://code.jquery.com/jquery-1.9.1.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/magnific-popup.js/1.1.0/jquery.magnific-popup.js"></script>
<script src="http://tonysatthejhouse.com/superadmin/assets/js/MagJS4.js"></script>
</body>
</html>
$(document).ready(function() {
$.magnificPopup.open({
items: {
src: 'http://tonysatthejhouse.com/superadmin/assets/extraimages/Restaurant_Week AD-01.jpg', // can be a HTML string, jQuery object, or CSS selector
type: 'image'
}
});
})
.white-popup {
width:500px;
height:700px;
overflow:auto;
padding:10px;
background:white;
border:2px solid black;
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
border-radius: 3px;
}

UCWA Skype for Business Online API Authentication - 403 Forbidden Applications Resource

I'm following this guide (https://msdn.microsoft.com/en-us/skype/ucwa/authenticationusingazuread) to attempt and authenticate and create a Skype App.
My goal is to create a Skype Meeting via the API and generate an Online Meeting URL.
I'm able to get as far as generating the Applications Resource URL.
When I attempt POST to the URL I receive a 403 Forbidden error. Looks like there might be an issue with the token? However I am using the token in earlier requests to get the App URL.
Any thoughts on what I am doing wrong?
Post Request:
POST https://webpool.infra.lync.com/ucwa/oauth/v1/applications HTTP/1.1
Connection: Keep-Alive
Content-Type: application/json; charset=utf-8
Authorization: Bearer (edited)
x-ms-request-root-id: a9c17f66-46d761cf7325d6a7
x-ms-request-id: |a9c17f66-46d761cf7325d6a7.6.
Request-Id: |a9c17f66-46d761cf7325d6a7.6.1.
Content-Length: 96
Host: webpoolblu0b11.infra.lync.com
{ UserAgent = UCWA Samples, EndpointId = f87e1d57-83a4-4f9b-aac7-00f05f440637, Culture = en-US }
Post Response:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/>
<title>403 - Forbidden: Access is denied.</title>
<style type="text/css">
<!--
body{margin:0;font-size:.7em;font-family:Verdana, Arial, Helvetica, sans-serif;background:#EEEEEE;}
fieldset{padding:0 15px 10px 15px;}
h1{font-size:2.4em;margin:0;color:#FFF;}
h2{font-size:1.7em;margin:0;color:#CC0000;}
h3{font-size:1.2em;margin:10px 0 0 0;color:#000000;}
#header{width:96%;margin:0 0 0 0;padding:6px 2% 6px 2%;font-family:"trebuchet MS", Verdana, sans-serif;color:#FFF;
background-color:#555555;}
#content{margin:0 0 0 2%;position:relative;}
.content-container{background:#FFF;width:96%;margin-top:8px;padding:10px;position:relative;}
-->
</style>
</head>
<body>
<div id="header"><h1>Server Error</h1></div>
<div id="content">
<div class="content-container"><fieldset>
<h2>403 - Forbidden: Access is denied.</h2>
<h3>You do not have permission to view this directory or page using the credentials that you supplied.</h3>
</fieldset></div>
</div>
</body>
</html>
Permissions:
I've figured this out. I wasn't serializing the JSON properly. Below is a fixed snippet:
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);
client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
var jsonObject = new
{
UserAgent = "UCWA Samples",
EndpointId = Guid.NewGuid().ToString(),
Culture = "en-US"
};
var createMeetingPostData = JsonConvert.SerializeObject(jsonObject);
var content = new StringContent(createMeetingPostData, Encoding.UTF8, "application/json");
var data = await client.PostAsync(appUrlData.appUrl, content);

very basic dojo: button not displaying icon

i am new to dojo and i am trying to make a button with an image, but the image does not show, besides, when one clicks the button, it correctly shows the "hi" alert.
the "zoom_in.png" image is right in the same directory with the html. And firebug shows no errors or warnings.
Update. thanks to ed, i managed to get it working via the declarative approach
<!DOCTYPE html>
<html >
<head>
<link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/dojo/1.10.3/dijit/themes/claro/claro.css">
<script>dojoConfig = {parseOnLoad: true}</script>
<script src="//ajax.googleapis.com/ajax/libs/dojo/1.10.3/dojo/dojo.js"></script>
<script>require(["dojo/parser", "dijit/form/Button"]);</script>
<style>
.zoom_in_icon {
background-image: url('zoom_in.png');
height: 25px;
width: 25px;
text-align: center;
background-repeat: no-repeat;
}
</style>
</head>
<body class="claro">
<button data-dojo-type="dijit/form/Button" data-dojo-props="iconClass:'zoom_in_icon'" type="button">
<script type="dojo/on" data-dojo-event="click" data-dojo-args="evt">
require(["dojo/dom"], function(dom){
alert( "Thank you! ");
});
</script>
</button>
<div id="result2"></div>
</body>
</html>
However, programatically, the problem persists
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Button</title>
<script src="//ajax.googleapis.com/ajax/libs/dojo/1.10.3/dojo/dojo.js" data-dojo-config="async: true"></script>
<style>
.zoom_in_icon {
background-image: url('zoom_in.png');
height: 250px;
width: 250px;
text-align: center;
background-repeat: no-repeat;
}
</style>
<script>
require([
"dijit/form/Button",
"dojo/domReady!"
],
function(Button) {
new Button({
title: 'Zoom in', iconClass:'zoom_in_icon',
onClick: function() { alert("hi"); }}, "zoom_in").startup();
});
</script>
</head>
<body>
<button id="zoom_in" type="button"></button>
</body>
</html>
thanks
If you want to create the button programatically you need to call startup() on the new Button, and you don't need the data-dojo-type="dijit/form/Button" or the parse in the html, if you want to create it declaratively you don't need the new button, but you need to set the icon in the html.
See the Programatic example here:
http://dojotoolkit.org/reference-guide/1.10/dijit/form/Button.html

dojo 1.8: Error: Tried to register widget with id==main_bContainer but that id is already registered

Hi I have a simple one as shown below that displays bordercontainer and contentpane.
I do not understand why the bordercontainer's id is registered twice since I only have one
id defined for bordercontainer.
The error stated: Error: Tried to register widget with id==main_bContainer but that id is already registered
Please advise where I got it wrong.
<!DOCTYPE html>
<html>
<head>
<title>Hello</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link rel="stylesheet" href="../dojo1_8/dijit/themes/soria/soria.css"/>
<link rel="stylesheet" href="../common.css"/>
<style type="text/css">
html, body
{
width: 100%;
height: 100%;
margin: 5px;
padding: 0px;
overflow: hidden;
}
</style>
</head>
<body class="soria">
<div id="main_bContainer" data-dojo-type="dijit/layout/BorderContainer" data-dojo-props="design:'sidebar'">
<div class="cP_Left" data-dojo-type="dijit/layout/ContentPane" data-dojo-props="region:'center'">
Content Pane A
</div>
<div class="cP_Right" data-dojo-type="dijit/layout/ContentPane" data-dojo-props="region:'right'">
Content Pane B
</div>
</div>
</body>
<script>
var dojoConfig =
{
parseOnLoad: true,//replace web controls based on theme soria
isDebug: true,//true for debuggin with aid from FireBug, Always set it to false, to avoid overhead
async: true,//
locale : "en-us"//
};
</script>
<script src='../dojo1_8/dojo/dojo.js'></script>
<script>require(["dojo/parser",
"dojo/ready",
"dojo/request",
"dijit/layout/BorderContainer",
"dijit/layout/ContentPane",
"dojo/domReady!"
], function(parser, ready, request)
{ready(function()
{parser.parse();
});
});
</script>
</html>
Thanks
Clement
Becuase you have parse() its 2 times.
Here dojoConfig = { parseOnLoad: true };
and here parser.parse();
Just parse only one the problem will solve.