What is the difference between Selenium and WebDriver seleniumProtocol in DefaultNode.json? - json

I am trying to set up Selenium Grid 2 and grabbed a sample json config file from here. My tests are written in C# using Selenium WebDriver. I am trying to figure out the difference between these two protocols and which one I should be using for WebDriver test.

There is another file here only for WebDriver . My understanding is "seleniumProtocol": "Selenium" provides the mechanism for Selenium 1 and "seleniumProtocol": "WebDriver" for Selenium WebDriver.
{
"capabilities":
[
{
"browserName": "firefox",
"maxInstances": 5,
"seleniumProtocol": "WebDriver"
},
{
"browserName": "chrome",
"maxInstances": 5,
"seleniumProtocol": "WebDriver"
},
{
"platform": "WINDOWS",
"browserName": "internet explorer",
"maxInstances": 1,
"seleniumProtocol": "WebDriver"
}
],
"configuration":
{
"proxy": "org.openqa.grid.selenium.proxy.DefaultRemoteProxy",
"maxSession": 5,
"port": 5555,
"host": ip,
"register": true,
"registerCycle": 5000,
"hubPort": 4444,
"hubHost": ip
}
}
Depending on the protocols commandline arguments changes too. I have another post here related to commandline to start the nodes

Related

CodeceptJS Puppeteer doesnt close browser window after finish

I am new to codeceptJS and Puppeteer, the bwoser window closes if I run only one sanity test but If I run multiple test cases. All the browser window keeps open and the terminal shows that the command is still running.
I have tried in the last line of the tests but doesnt work as all of them are in sepearte windows.
I.closeOtherTabs();
multiple test cases:
require('./app/stores/Schedule.js');
require('./app/stores/Configuration.js');
require('./app/stores/Submit.js');
codecept config file:
const testUrl = (!process.env.E2E_URL ? "http://localhost:3001" : process.env.E2E_URL);
const testCases = (!process.env.E2E_URL ? "./automation-test/sanity/dev.sanity.e2e.test.js" : "./automation-test/sanity/prod.sanity.e2e.test.js");
exports.config = {
"tests": testCases,
"timeout": 10000,
"output": "./output",
"helpers": {
"Puppeteer": {
"url": testUrl,
"browser": "chrome",
"windowSize": "1280x800",
"show": true,
"switches": {
"ignore-certificate-errors": true
}
}
},
"include": {
"I": "./automation-test/sanity/steps_file.js"
},
"bootstrap": false,
"mocha": {
"timeout": 10
},
"name": "test"
};

VS Code API extension development - configuration points issue

This is from package.json file:
"configuration": [
{
"id": "projectmanager",
"title": "Enable or Disable project manager",
"order": 1,
"properties": {
"AIO.projectmanager": {
"type": "boolean",
"order": 1,
"description": "Enabled - true, Disabled - false : for Project manager."
}
}
}
When I debug and run it, the setting does not show up in a GUI nor in the settings.json of the extension development host.
Any way to fix this?
Edit: When i run the extension, it sends a notification saying "[my:\extension\workspace]: property engines is mandatory and must be of type object "

Nightwatch with Chrome on Windows: Currently Unusable?

Since my chrome update, I cannot make any nightwatch tests work on Windows 10.
At first the system simply couldn't set values. So I updated to the latest nightwatch, then updated to latest chromedriver.exe and latest selenium jar.
Now the test simply shows data: in the url of the driven browser instead of loading the page. There is also a "disable developer mode extensions" popup and a warning that "--ignore-certificate-errors" is no longer supported.
Any ideas what I'm supposed to have done?
Chromedriver.exe version: 2.38
Selenium Standalone Server: selenium-server-standalone-3.9.1.jar
Nightwatch version: nightwatch#0.9.21
Thanks for any help. Here's my config:
{
"src_folders": ["tests"],
"output_folder": "reports",
"custom_commands_path": "",
"custom_assertions_path": "",
"page_objects_path": "pages",
"globals_path": "globals",
"selenium": {
"start_process": true,
"server_path": "./lib/selenium-server-standalone-3.9.1.jar",
"log_path": "./reports",
"host": "127.0.0.1",
"port": 4444,
"cli_args": {
"webdriver.chrome.driver": "./lib/chromedriver.exe"
}
},
"test_settings": {
"default": {
"launch_url": "https://modaquote.com",
"selenium_port": 4444,
"selenium_host": "localhost",
"silent": true,
"desiredCapabilities": {
"browserName": "chrome",
"javascriptEnabled": true,
"acceptSslCerts": true
}
}
}
}
You have to update Chromedriver to match your new version of Chrome. It should fix there issues.

Include root in django rest framework responses

I have a ready Django project that serves JSON via the rest_framework and its viewsets. Now I would like to write the client using Ember. Here is my setup:
Django 1.6.5
Ember 1.6.1
Ember-Data 1.0.0-beta.8.2a68c63a
jQuery 2.1.1
My Django server runs on the default port 8000 under localhost. I test my Ember application by opening index.html in the browser. Therefore, I customised the ApplicationAdapter like so
App.ApplicationAdapter = DS.RESTAdapter.extend({
host: 'http://localhost:8000',
});
I try to fetch a list of artists from http://localhost:8000/artists. The specified route is
App.ArtistsRoute = Ember.Route.extend({
model: function() {
this.store.find('artists');
}
});
And the response I get back from the server when I open the mentioned url in the browser is
[
{
"id": 1,
"name": "Kollegah",
"origin": "Germany",
"genre": "German Rap"
},
{
"id": 2,
"name": "Peter Fox",
"origin": "Germany",
"genre": "Hip-Hop"
},
{
"id": 3,
"name": "Farid Bang",
"origin": "Germany",
"genre": "German Rap"
},
{
"id": 4,
"name": "Eko Fresh",
"origin": "Germany",
"genre": "German Rap"
}
]
When fetching the data I these two Ember errors:
-Error while processing route: artists No model was found for 'artists' Error: No model was found for 'artists'
-No model was found for 'artists' Error: No model was found for 'artists'
The problem is that I have specified a model already
var attr = DS.attr;
App.Artist = DS.Model.extend({
name: attr,
origin: attr,
genre: attr,
});
I suppose the problem is the missing root element at the beginning of each JSON response. I suggest it should look like this example from the Ember Guides:
{
"post": {
"id": 1,
"title": "Rails is omakase",
"comments": ["1", "2"],
"user" : "dhh"
},
"comments": [{
"id": "1",
"body": "Rails is unagi"
}, {
"id": "2",
"body": "Omakase O_o"
}]
}
After searching a short while I found a similar problems with Rails. I tried out the solution for Django mentioned in another Stackoverflow question but I got the same errors.
Does anybody know a server-side solution for this problem? The Ember Data Django Adapter could be one for the client side. Unfortunately, it is designed as a node plugin and at the moment I don't use it for my project.
The Ember Data Django Adapter is the most simple way of solving your problem, and if you pay attention to the docs, there are instructions for using it without ember-cli.

Run WebDriver with Chrome Canary?

Is there a way to tell chromedriver (the webdriver implementation within Chrome) to use Canary, Beta or current production chrome?
You can ask ChromeDriver to use a Chrome executable in a non-standard location
ChromeOptions options = new ChromeOptions();
options.setBinary("/path/to/other/chrome.exe");
On Mac OS X, this should be the actual binary, not just the app. e.g., /Applications/Google Chrome.app/Contents/MacOS/Google Chrome.
[via chromedriver Capabilities and Switches]
And the way to do this in theintern is by the following config
capabilities: {
'selenium-version': '2.35.0',
'chrome': {chromeOptions: {'binary': '/Applications/Google\ Chrome\ Canary.app/Contents/MacOS/Google\ Chrome\ Canary'}},
},
Also, if you're looking to configure the selenium node directly here's how to pass the configuration in:
{
"capabilities": [
{
"browserName": "chrome",
"platform": "MAC"
},
{
"browserName": "chromeCanary",
"platform": "MAC",
"chromeOptions": {
"binary": "/Applications/Google\ Chrome\ Canary.app/Contents/MacOS/Google\ Chrome\ Canary"
},
"maxInstances": 1,
"seleniumProtocol": "WebDriver"
},
{
"browserName": "firefox",
"platform": "MAC"
}
],
"configuration": {
"host": "localhost",
"port": 8989,
"hubPort": 4444,
"hubHost": "localhost"
}
}
It should be this Google Chrome Canary.app and not just Google Chrome.app.
Try this:
options.setBinary("/Applications/Google Chrome Canary.app/Contents/MacOS/Google Chrome Canary");
ChromeDriver driver = new ChromeDriver(options);