webdriver: Request failed with status 404 due to invalid session id: invalid session id - webdriver

I have a Selenium nodejs project, that runs perfect on win10 OS. I need to run it in aws Codebuild project, but keep getting these error:
WARN webdriver: Request failed with status 500 due to unknown error: session deleted because of page crash
from unknown error: cannot determine loading status
from tab crashed
ERROR webdriver: Request failed with status 404 due to invalid session id: invalid session id
ERROR #wdio/sync: invalid session id
My wdio.config file:
var baseUrl;
if(process.env.SERVER === 'prod'){
baseUrl = 'https://app.xxx.com';
}else if(process.env.SERVER === 'dev'){
baseUrl = 'https://dev.xxx.com';
}else {
baseUrl = 'https://test.xxx.com';
}
var timeout = process.env.DEBUG ? 99999999 : 90000;
exports.config = {
runner: 'local',
specs: [
'./tests/*.js'
],
exclude: [
'./pageObjects/*_Page.js'
],
maxInstances: 10,
capabilities: [{
maxInstances: 10,
browserName: 'chrome',
acceptInsecureCerts: true,
'goog:chromeOptions': {
args: ['--headless', '--no-sandbox', '--disable-gpu', '--disable-dev-shm-usage --window-size=1920,1080', '--disable-translate', '--disable-extensions', '--disable-background-networking', '--disable-sync', '--disable-default-apps', '--mute-audio', '--no-first-run', '--disable-prompt-on-repost']
}
}],
logLevel: 'trace',
bail: 0,
baseUrl: baseUrl,
headless: true,
waitforTimeout: 90000,
connectionRetryTimeout: 120000,
connectionRetryCount: 3,
services: ['chromedriver', 'Selenium-standalone'],
framework: 'mocha',
reporters: [['allure', {
outputDir: './reports/allure-results',
disableWebdriverStepsReporting: true,
disableWebdriverScreenshotsReporting: false
}]],
mochaOpts: {
ui: 'bdd',
timeout: timeout
},
before: function (capabilities, specs) {
assert = require('chai').assert;
expect = require('chai').expect;
},
afterTest: function(test, context, { error, result, duration, passed, retries }) {
if (error)
browser.takeScreenshot();
},
after: function (result, capabilities, specs) {
var name = 'ERROR-chrome-' + Date.now()
browser.saveScreenshot('./errorShots/' + name + '.png')
},
}
My Codebuild builldspec:
version: 0.2
phases:
install:
the build fails.
runtime-versions:
nodejs: 12
pre_build:
commands:
- yes | yum update
- yes | yum install gcc-c++
- yes | yum install java-1.8.0-openjdk
- wget https://dl.google.com/linux/direct/google-chrome-stable_current_x86_64.rpm
- yes | yum install ./google-chrome-stable_current_x86_64.rpm
- ln -s /usr/bin/google-chrome-stable /usr/bin/chromium
- cd /tmp/
- wget https://chromedriver.storage.googleapis.com/94.0.4606.61/chromedriver_linux64.zip
- unzip chromedriver_linux64.zip
- mv chromedriver /usr/bin/chromedriver
build:
commands:
- pwd
- ls
- git clone https://XXXXXXX automation
- cd automation
- mkdir errorShots
- npm install
- npm install -g allure-commandline --save-dev
- npm test
- allure generate .\reports\allure-results --clean
What might be missing? Thanks

Related

How to verify polygon smart contract using truffle?

I deployed a simple NFT smart contract on polygon mumbai testnet but when I am trying to verify it then It is showing an error. please guide me how to verify it...
This is the error which I am getting
PS C:\Users\Sumits\Desktop\truffle> truffle run verify MyNFT --network matic --debug
DEBUG logging is turned ON
Running truffle-plugin-verify v0.5.20
Retrieving network's chain ID
Verifying MyNFT
Reading artifact file at C:\Users\Sumits\Desktop\truffle\build\contracts\MyNFT.json
Failed to verify 1 contract(s): MyNFT
PS C:\Users\Sumits\Desktop\truffle>
This is my truffle-config.js
const HDWalletProvider = require('#truffle/hdwallet-provider');
const fs = require('fs');
const mnemonic = fs.readFileSync(".secret").toString().trim();
module.exports = {
networks: {
development: {
host: "127.0.0.1", // Localhost (default: none)
port: 8545, // Standard Ethereum port (default: none)
network_id: "*", // Any network (default: none)
},
matic: {
provider: () => new HDWalletProvider(mnemonic, `https://rpc-mumbai.maticvigil.com`),
network_id: 80001,
confirmations: 2,
timeoutBlocks: 200,
skipDryRun: true
},
},
// Set default mocha options here, use special reporters etc.
mocha: {
// timeout: 100000
},
// Configure your compilers
compilers: {
solc: {
version: "^0.8.0",
}
},
plugins: ['truffle-plugin-verify'],
api_keys: {
polygonscan: 'BTWY55K812M*******WM9NAAQP1H3'
}
}
First deploy the contract:
truffle migrate --network matic --reset
I am not sure if you successfully deploy it to matic network, because your configuration does not seem to be correct:
matic: {
// make sure you set up provider correct
provider: () => new HDWalletProvider(mnemonic, `https://rpc-mumbai.maticvigil.com/v1/YOURPROJECTID`),
network_id: 80001,
confirmations: 2,
timeoutBlocks: 200,
skipDryRun: true
},
Then verify.
truffle run verify ContractName --network matic
ContractName should be the name of the contract, not the name of the file
please make sure you are putting the polygonscan api key in lowercase

How to use IE 11 in webdriverio.io v7

After some research, I am trying to use the following code in the wdio.conf.js file in order to use IE 11 with webdriver.io version 7. It still isn't working. Any suggestions?
This is what I am using in wdio.conf.js.
line 1:
const drivers = {
ie: {
version: "3.150.1", // or whatever latest is
arch: "ia32", // forces use of 32 bit driver
baseURL: "https://selenium-release.storage.googleapis.com"
},
};
exports.config = {
// ...
line 65, with the browserName,
capabilities: [{
// maxInstances can get overwritten per capability. So if you have an in-house Selenium
// grid with only 5 firefox instances available you can make sure that not more than
// 5 instances get started at a time.
maxInstances: 5,
browserName: 'ie',
acceptInsecureCerts: true
// If outputDir is provided WebdriverIO can capture driver session logs
// it is possible to configure which logTypes to include/exclude.
// excludeDriverLogs: ['*'], // pass '*' to exclude all driver session logs
// excludeDriverLogs: ['bugreport', 'server'],
}],
line 131:
path: '/wd/hub',
services: [
['selenium-standalone', {
logPath: 'logs',
installArgs: { drivers }, // drivers to install
args: { drivers } // drivers to use
}]
],
The above information is largely based on https://webdriver.io/docs/selenium-standalone-service.
I have downloaded IEServerDriver.exe and Selenium Server (Grid) from https://www.selenium.dev/downloads/ and started them on their respective ports.
This is the error I'm seeing:
ERROR webdriver: Request failed with status 500 d
ue to session not created: Unable to create session from {
[0-0] "desiredCapabilities": {
[0-0] "browserName": "ie"
[0-0] },
[0-0] "capabilities": {
[0-0] "firstMatch": [
[0-0] {
[0-0] "browserName": "ie"
[0-0] }
[0-0] ]
[0-0] }
[0-0] }
If anyone has succeeded in using IE 11 with webdriver.io version 7, I welcome suggestions. I have also tried services such as services: ['iexplorerdriver'],, but to no avail. I see that it's not listed at https://webdriver.io/docs/gettingstarted for this version.
I finally found a way, and I think this will work for you.
http://v4.webdriver.io/guide/services/iedriver.html
This was written for webdriver 4, but it still works in webdriver 7.
I used these capabilities:
capabilities: [{
maxInstances: 1,
browserName: 'internet explorer',
acceptInsecureCerts: false
}],
For services, I think this is all that is needed:
services: ['iedriver'],
Of course, you have to install it via command line first:
npm install wdio-iedriver-service --save-dev

How to specify or override TypeScript config in Deno

I'm starting out on a new Deno project and ran into errors
const users = [
{ name: 'Oby', age: 12 },
{ name: 'Heera', age: 32 },
];
const loggedInUser = users.find((u) => u.name === 'Oby');
console.log(loggedInUser.age);
$ deno run hello.ts
Compile file:///Users/yangshun/Downloads/deno-test/hello.ts
error: TS2532 [ERROR]: Object is possibly 'undefined'.
console.log(loggedInUser.age);
This is caused by "strictNullChecks": true in the TypeScript config. Hence I would like to use my own tsconfig.json (TypeScript configuration) but am not sure how to go about doing so.
Create a tsconfig.json file.
{
"compilerOptions": {
"strictNullChecks": false
}
}
Execute the deno run with the -c configuration argument.
$ deno run -c tsconfig.json hello.ts
Compile file:///Users/yangshun/Downloads/deno-test/hello.ts
12

Meteor Up - Error: connect ECONNREFUSED 192.168.100.12:

I have a Meteor App based on Angular 1.3 + Meteor 1.5.2.2.
I am using Ubuntu 17.
I am trying to deploy my Meteor App on local machine first before going for live server using Meteor Up.
But I am facing this issue when running mup setup command
martinihenry#martinihenry:~/mytestapp-prod/.deploy$ mup setup
Started TaskList: Setup Docker
[192.168.100.12] - Setup Docker
events.js:141
throw er; // Unhandled 'error' event
^
Error: connect ECONNREFUSED 192.168.100.12:22
at Object.exports._errnoException (util.js:907:11)
at exports._exceptionWithHostPort (util.js:930:20)
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1078:14)
Here is my mup.json:
module.exports = {
servers: {
one: {
// TODO: set host address, username, and authentication method
host: '192.168.100.12',
username: 'root',
// pem: './path/to/pem'
// password: 'server-password'
// or neither for authenticate from ssh-agent
}
},
app: {
// TODO: change app name and path
name: 'mytestapp-prod',
path: '../',
servers: {
one: {},
},
buildOptions: {
serverOnly: true,
},
env: {
// TODO: Change to your app's url
// If you are using ssl, it needs to start with https://
ROOT_URL: '192.168.100.12:3000',
MONGO_URL: 'mongodb://localhost/meteor',
},
// ssl: { // (optional)
// // Enables let's encrypt (optional)
// autogenerate: {
// email: 'email.address#domain.com',
// // comma separated list of domains
// domains: 'website.com,www.website.com'
// }
// },
docker: {
// change to 'kadirahq/meteord' if your app is using Meteor 1.3 or older
image: 'abernix/meteord:base',
},
// Show progress bar while uploading bundle to server
// You might need to disable it on CI servers
enableUploadProgressBar: true
},
mongo: {
version: '3.4.1',
servers: {
one: {}
}
}
};
What could be wrong here?
It looks like you don't have sshd running on your machine, or you have not enabled remote ssh access for root.
You need to edit /etc/ssh/sshd_config, and comment out the following line:
PermitRootLogin without-password
Just below it, add the following line:
PermitRootLogin yes
Then restart SSH:
service ssh restart
I know this is late, but this a known and reproducable bug resulting from inotfiy-watch using all of the available slots for watches, and while very misleading, it actually has absolutely nothing to do with disk space.
The easy fix? increase watch slots:
sudo -i
echo 1048576 > /proc/sys/fs/inotify/max_user_watches
exit

Meteor mup deploy error

I am continuously getting this error on meteor app deployment using mup deploy command.
mup setup command is working just fine. When mup deploy starts, it executes many commands and reach to a command where it says
'minifying app code'. It stays there for 5-6 mins and then this error occurs.
What can be causing this error and how to resolve this?
mup deploy --verbose
Building App Bundle Locally
Minifying app code
=> Build Error. Check the logs printed above.
Error: build-error
at ChildProcess.<anonymous> (/usr/lib/node_modules/mup/lib/modules/meteor/build.js:46:16)
at emitTwo (events.js:106:13)
at ChildProcess.emit (events.js:194:7)
at maybeClose (internal/child_process.js:899:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
Here is my mup.js file.
Other stats
node v7.7.2
npm v4.1.2
module.exports = {
servers: {
one: {
// TODO: set host address, username, and authentication method
host: '54.218.35.182',
username: 'ubuntu',
pem: '~/.ssh/iAssureIT-Ubuntu2.pem'
// password: 'server-password'
// or neither for authenticate from ssh-agent
}
},
meteor: {
// TODO: change app name and path
name: 'musissive',
path: '/var/www/meteor/musissive',
servers: {
one: {},
},
buildOptions: {
serverOnly: true,
},
env: {
// TODO: Change to your app's url
// If you are using ssl, it needs to start with https://
ROOT_URL: 'http://musifyindia.com',
MONGO_URL: 'mongodb://localhost/meteor',
PORT: 3003,
},
docker: {
// change to 'kadirahq/meteord' if your app is not using Meteor 1.4
image: 'abernix/meteord:base',
},
// This is the maximum time in seconds it will wait
// for your app to start
// Add 30 seconds if the server has 512mb of ram
// And 30 more if you have binary npm dependencies.
deployCheckWaitTime: 2400,
// Show progress bar while uploading bundle to server
// You might need to disable it on CI servers
enableUploadProgressBar: true
},
mongo: {
port: 27017,
version: '3.4.1',
servers: {
one: {}
}
}
};
The error happening in meteor build had nothing to do with MUP.js. The issue was with low RAM on server. I was trying the build with free EC2 instance whihc has max 1 GB available. This is not sufficient for Meteor Build. When I upgraded to 4 GB instance, it started working just fine.

Resources