upload document not working as part of Continuous integration bamboo - protractor

I am trying to validate PDF document upload functionality however it is working fine in local where it picks the path from local folder however it is failing as part of Bamboo+Sauce+Qtest integration execution.
Below is the code snippet i have used to upload the documentin local which is working fine :
var path = require('path');
var absolutePath = path.resolve(__dirname, "../uploads/Replace.pdf");
element(by.css('input[type=file][ng-model="detailDocuments.selectedFiles.selectedIbl"]')).sendKeys(absolutePath);
browserActions.clickOn(applicants.uploadBtn('Replace'));
Below is the code snippet which i have used to upload document as part of CI.
var path = require('path');
var remote = require('selenium-webdriver/remote');
browser.setFileDetector(new remote.FileDetector());
var absolutePath = path.resolve(__dirname, "../uploads/Replace.pdf");
element(by.css('input[type=file][ng-model="detailDocuments.selectedFiles.selectedIbl"]')).sendKeys(absolutePath);
browser.sleep(2000);
browserActions.clickOn(applicants.uploadBtn('Replace'));
browser.sleep(3000);
In the bamboo it showing below error message:
Failures:
build 18-Feb-2019 13:15:56 1) IEATA.2356*: validation_for_upload_or_replace_documents_IEATA-2356 IEATA-2356 step 4: verification of applicantdetails page
build 18-Feb-2019 13:15:56 Message:
build 18-Feb-2019 13:15:56 [31m Failed: invalid argument: File not found : /opt/atlassian-bamboo/bamboo-agent-home/xml-data/build-dir/EQ-PBR-JOB1/regression/bws/uploads/Test.pdf
build 18-Feb-2019 13:15:56 (Session info: chrome=71.0.3578.80)
build 18-Feb-2019 13:15:56 (Driver info: chromedriver=2.44.609538 (b655c5a60b0b544917107a59d4153d4bf78e1b90),platform=Windows NT 6.1.7601 SP1 x86_64)[0m
build 18-Feb-2019 13:15:56 Stack:
build 18-Feb-2019 13:15:56 WebDriverError: invalid argument: File not found : /opt/atlassian-bamboo/bamboo-agent-home/xml-data/build-dir/EQ-PBR-JOB1/regression/bws/uploads/Test.pdf
build 18-Feb-2019 13:15:56 (Session info: chrome=71.0.3578.80)
build 18-Feb-2019 13:15:56 (Driver info: chromedriver=2.44.609538
The PDF documents are available in protractor/uploads.

Related

Sonar scanner github action fails intermittently with “Fail to parse entry in bootstrap index”. Passes on re-run of the job

Which versions am I using
I'm using Sonarqube CE 8.9 hosted in Google cloud VM accessible via an internal domain URL.
Github action runs sonar scanner as part of PR builds on a web app project: SonarSource/sonarqube-scan-action#v1.1.0
what problem am I facing?
Sonar scanner github action intermittently fails with Fail to parse entry in bootstrap index: <!DOCTYPE html>.
If the job is run again, it successfully completes. So I'm not sure what is going wrong.
This is the log from sonar scanner run with verbose=true
INFO: Scanner configuration file: /opt/sonar-scanner/conf/sonar-scanner.properties
INFO: Project root configuration file: NONE
06:39:11.701 INFO: SonarScanner 4.7.0.2747
06:39:11.702 INFO: Java 11.0.17 Alpine (64-bit)
06:39:11.703 INFO: Linux 5.15.0-1022-azure amd64
06:39:11.837 DEBUG: keyStore is :
06:39:11.838 DEBUG: keyStore type is : pkcs12
06:39:11.838 DEBUG: keyStore provider is :
06:39:11.839 DEBUG: init keystore
06:39:11.839 DEBUG: init keymanager of type SunX509
06:39:11.981 DEBUG: Create: /opt/sonar-scanner/.sonar/cache
06:39:11.982 INFO: User cache: /opt/sonar-scanner/.sonar/cache
06:39:11.982 DEBUG: Create: /opt/sonar-scanner/.sonar/cache/_tmp
06:39:11.984 DEBUG: Extract sonar-scanner-api-batch in temp...
06:39:11.987 DEBUG: Get bootstrap index...
06:39:11.987 DEBUG: Download: ***/batch/index
06:39:12.678 DEBUG: Get bootstrap completed
06:39:12.681 INFO: ------------------------------------------------------------------------
06:39:12.681 INFO: EXECUTION FAILURE
06:39:12.681 INFO: ------------------------------------------------------------------------
06:39:12.681 INFO: Total time: 1.015s
06:39:12.697 INFO: Final Memory: 4M/17M
06:39:12.698 INFO: ------------------------------------------------------------------------
06:39:12.699 ERROR: Error during SonarScanner execution
org.sonarsource.scanner.api.internal.ScannerException: Unable to execute SonarScanner analysis
at org.sonarsource.scanner.api.internal.IsolatedLauncherFactory.lambda$createLauncher$0(IsolatedLauncherFactory.java:85)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at org.sonarsource.scanner.api.internal.IsolatedLauncherFactory.createLauncher(IsolatedLauncherFactory.java:74)
at org.sonarsource.scanner.api.internal.IsolatedLauncherFactory.createLauncher(IsolatedLauncherFactory.java:70)
at org.sonarsource.scanner.api.EmbeddedScanner.doStart(EmbeddedScanner.java:185)
at org.sonarsource.scanner.api.EmbeddedScanner.start(EmbeddedScanner.java:123)
at org.sonarsource.scanner.cli.Main.execute(Main.java:73)
at org.sonarsource.scanner.cli.Main.main(Main.java:61)
Caused by: java.lang.IllegalStateException: Fail to parse entry in bootstrap index: <!DOCTYPE html>
at org.sonarsource.scanner.api.internal.BootstrapIndexDownloader.parse(BootstrapIndexDownloader.java:59)
at org.sonarsource.scanner.api.internal.BootstrapIndexDownloader.getIndex(BootstrapIndexDownloader.java:44)
at org.sonarsource.scanner.api.internal.JarDownloader.getScannerEngineFiles(JarDownloader.java:58)
at org.sonarsource.scanner.api.internal.JarDownloader.download(JarDownloader.java:53)
at org.sonarsource.scanner.api.internal.IsolatedLauncherFactory.lambda$createLauncher$0(IsolatedLauncherFactory.java:76)
... 7 more
06:39:12.706 ERROR:
06:39:12.706 ERROR: Re-run SonarScanner using the -X switch to enable full debug logging.
what have I tried to debug this issue?
I checked whether there is any issue with the sonar URL but it is fine because the scanner works fine otherwise. Apart from this I'm not sure what else I can check.
Also is there a difference between running the sonar scanner with -X and running it with -Dsonar.verbose=true ?

How to solve "ERROR: Import of Jasper report server export zip failed!"

I am getting the following error when trying to run js-import script as root user.
INFO: Jasper report server install successful!
PORTAL_HOME =
cp: cannot stat ‘/jasper/install/distributions/jasperReports/lib/*’: No such file or directory
Using CATALINA_BASE: /opt/jasper/tomcat/apache-tomcat-9.0.56
Using CATALINA_HOME: /opt/jasper/tomcat/apache-tomcat-9.0.56
Using CATALINA_TMPDIR: /opt/jasper/tomcat/apache-tomcat-9.0.56/temp
Using JRE_HOME: /usr/java/jdk1.8.0_312
Using CLASSPATH: /opt/jasper/tomcat/apache-tomcat-9.0.56/bin/bootstrap.jar:/opt/jasper/tomcat/apache-tomcat-9.0.56/bin/tomcat-juli.jar
Using CATALINA_OPTS:
Using CATALINA_PID: /opt/jasper/tomcat/apache-tomcat-9.0.56/catalina_pid.txt
Existing PID file found during start.
Removing/clearing stale PID file.
Tomcat started.
Waiting on Tomcat to start - Retry 1/5 in 60s
INFO: Tomcat started Successfully!
Running the JS import script [/jasper/install/scripts/runJSTestInstall.sh.tmp].
ERROR: Import of Jasper report server export zip failed!
ERROR: Main install failed while executing child script [installJasperReports]!
INFO: Check the [installJasperReports.log] file for more details.
INFO: Fix the issue and then run [uninstallJasperReports.sh /jasper/install] followed by [installAll.sh /jasper/install installJasperReports] to resume.
I get the below log in js-import file relevant to the above error.
VALIDATION COMPLETED
Total time: 4 seconds
Executing CE version
First resource path: /opt/jasper/jasperReports/jasperreports-server-cp-8.0.0-bin/buildomatic/conf_source/ieCe
Loading configuration resources
Initialization complete
Processing started
Tenant not found with Tenant ID "organizations"
Please give a solution for this!

ECONNREFUSED Webdriver errors in eclipse when running Protractor

So, I was following this tutorial on getting my existing protractor files imported to Eclipse as Java project, installing angular/protractor configurations on eclipse and running the files:
https://www.youtube.com/watch?v=8dZ3isYcthI
But then I got into the weeds on this error: Error while running conf.js file from Eclipse
In attempt to resolve it, following instructions on the youtube tutorial, I replaced the selenium webdriver folder in Eclipse with the selenium webdriver folder in my node modules folder in AppData by dragging and dropping
Now my conf.js file will not run as protractor on Eclipse even though the file will execute successfully from the command line. Error is:
(node:53640) DeprecationWarning: os.tmpDir() is deprecated. Use os.tmpdir() instead.
[15:11:38] I/launcher - Running 1 instances of WebDriver
[15:11:38] I/hosted - Using the selenium server at http://localhost:4444 /wd/hub
[15:11:39] E/launcher - Error code: 135
[15:11:39] E/launcher - Error message: ECONNREFUSED connect ECONNREFUSED 127.0.0.1:4444
[15:11:39] E/launcher - Error: ECONNREFUSED connect ECONNREFUSED 127.0.0.1:4444 at ClientRequest. (C:\Workspace\testUltimateQASite\node_modules\selenium-webdriver\http\index.js:238:15)
The js line it is pointing to in the index file is the last line of this function:
request.on('error', function(e) {
if (e.code === 'ECONNRESET') {
setTimeout(function() {
sendRequest(options, onOk, onError, opt_data, opt_proxy);
}, 15);
} else {
var message = e.message;
if (e.code) {
message = e.code + ' ' + message;
}
onError(new Error(message));
}
});
My conf.js file is as follows:
// conf.js
//var jasmineReporters = require('jasmine-reporters');
var os = require('os'); os.tmpDir = os.tmpdir;
exports.config = {
framework: 'jasmine',
seleniumAddress: 'http://localhost:4444/wd/hub',
specs: ['qaSpec.js'],
//module.exports = {
params: {
url : 'http://phptravels.com/demo/'
/* login: {
url: 'http://phptravels.com/demo/',
username: 'juliel#ibm.com',
password: 'password'
}*/
}
};
The error is basically stating that your Selenium server doesn't seem to be running. Notice how you are seeing a connection refused error.
Please check if you have started the selenium server as described in the official documentation here : http://www.protractortest.org/#/tutorial#setup
For more information on setting up eclipse and protractor you might want to refer here as well :https://github.com/angelozerr/angularjs-eclipse/wiki/Protractor
I tried to understand your project's architecture by reading post several times and still got a bit confused.
I am not sure how do you manage Webdriver?
For Protractor project I would recommend using proper NodeJS project's structure as well as using any JS task runner. Grunt might be a good choice.
There are plenty Webdriver Manager plugins as well as Protractor managers so you will be able to load your project's dependencies and run test with single Grunt command.
UPDATE: this demo project might be useful in understanding the use of Grunt and its dependencies in Angular project's architecture.

Trying to create sailsjs policy fails with hook "userconfig" error

I can not get policy in sailsjs to work.
I end up at the same place over and over
At simplest
1) I issued sails new testProject
2) I add folder policies under config
3) I added file under folder added isAuthenticated.js
A hook (`userconfig`) failed to load!
sails lift --verbose
info: Starting app...
verbose: Setting Node environment...
verbose: Please run `npm install coffee-script` to use coffescript (skipping for now)
verbose: moduleloader hook loaded successfully.
verbose: Loading app config...
error: A hook (`userconfig`) failed to load!
verbose: Lowering sails...
verbose: Shutting down socket server...
verbose: Shutting down HTTP server...
error: Error: Invalid module:function isAuthenticated(req, res, next) {
if (req.isAuthenticated()) {
return next();
}
else{
return res.redirect('/login');
}
}

Can't build the facebook bindings

I just downloaded these facebook bindings : https://github.com/mono/monotouch-bindings/tree/master/facebook
I use "make" command from facebook/binding/ directory but i can't build Facebook.dll.Here is the error:
Project "/Users/abc/facebook/binding/MonoTouch.FacebookConnect.csproj" (default target(s)): Target _AssignBundleResourceNames: /Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Xamarin.ObjcBinding.Common.targets: error : Error executing task AssignBundleResourceNames: Invalid reserved metadata name Task "AssignBundleResourceNames" execution -- FAILED Done building target "_AssignBundleResourceNames" in project "/Users/abc/facebook/binding/MonoTouch.FacebookConnect.csproj".-- FAILED Done building project "/Users/abc/facebook/binding/MonoTouch.FacebookConnect.csproj".-- FAILED
Build FAILED. Errors:
/Users/abc/facebook/binding/MonoTouch.FacebookConnect.csproj (default targets) -> /Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Xamarin.ObjcBinding.Common.targets (_AssignBundleResourceNames target) ->
/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Xamarin.ObjcBinding.Common.targets: error : Error executing task AssignBundleResourceNames: Invalid reserved metadata name