Cannot access Shared Drive/Network path with Bamboo - bamboo

Shared/Network drive not accessible through bamboo test execution
Architecture
Bamboo Server (Windows)
Agent (Windows)
Selenium Nodes (Windows)
Java, Cucumber and JUnit
Bitbucket
 
We have a requirement to access files located at some shared location while executing tests from Bamboo Plans.
All the corresponding servers have access to the shared. Manually verified.
File file = new File("\\\\SHARED_DRIVE\\Folder\\Automation\\download");
System.out.println(file.exists());
System.out.println(file.isDirectory());
System.out.println(file.isFile());
Scenario 1 : Executing test through IDE (locally)
true
true
true
Scenario 2 : Executing test on Agent's VM
true
true
true
Scenario 3 : Executing test through Bamboo Plan
false
false
false
 
As stated above, results were false while accessing shared drive when we were executing tests though Bamboo plan.
As stated in Scenario 2, we have manually logged in to the Agent's VM and executed maven goal and checked the logs
What could be the possible issue here?

Related

Azure Devops Browserstack integration - BrowserStackResults task - Unexpected "Build not found by name" error

Trying to set up Azure Devops pipeline for test automation run (Java + Maven + Selenium) tests are running on Browserstack
To view Browser Stack Results I added two tasks BrowserStackConfig and BrowserStackResults to pipiline YAML file
(according to instructions from BrowserStack)
But I am getting unexpected error on BrowserStackResults step : 'Build not found by name ..'
Now I am trying to get results for "old" automation run on BS (Set BROWSERSTACK_BUILD_NAME to existing BS results = 20220114_666666)
Setup:
Using Azure Devops with installed Browserstack extension
Steps:
Prepared YML file
Add pipeline for YML
Run pipeline
Result:
BS Configuration step works
Unexpected error on BrowserStackResults step "##[error] Build not found by name: "20220114_666666" error
The following only fixes BrowserStackConfig task:
variables:
- name: BROWSERSTACK_BUILD_NAME
value: "test-001"
But not for BrowserStackResults task. Is there another environment variable that controls the later? Or a list of variables used by browserstack?
According to the Browserstack
Note: Ensure to set the build capability in your test script using the environment variable BROWSERSTACK_BUILD_NAME. The extension will fail to embed test reports in your pipeline if this capability is missing.
Set variables for BrowserStack Azure DevOps Extension
The BrowserStack Azure DevOps extension, by default, sets the following environment variables:
BROWSERSTACK_USERNAME
BROWSERSTACK_ACCESS_KEY
BROWSERSTACK_LOCAL
BROWSERSTACK_LOCAL_IDENTIFIER
BROWSERSTACK_BUILD_NAME
When you create a service connection, the BROWSERSTACK_USERNAME and the BROWSERSTACK_ACCESS_KEY are automatically added as variables during the configuration step.
The extension also adds the BROWSERSTACK_BUILD_NAME variable that autogenerates a build name for your test runs.
Edit your test script to call environment variables
Edit your test script to add the environment variables for setting capabilities using the following code snippets:
String buildName = System.getenv("BROWSERSTACK_BUILD_NAME");
DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability("build", buildName); // CI/CD job name using BROWSERSTACK_BUILD_NAME env variable
Seems you need to check your code if BROWSERSTACK_BUILD_NAME environment variable value is passed to buildName and added to capabilities. Otherwise, the report won't be generated

can't trigger a test of some appllication via Jenkins job

I am a beginner at the field of Devops.
I have created a simple web application (jsp), using 3 Jenkins jobs to store the code in GIT, to deploy the this app into Tomcat, and also to site-monitor this app (respectively).
Now, I have been trying - with no success -to automate a simple test with 2 verifications of my app functionality, using Selenium IDE and triggering it via Jenkins job (the fourth one in my project).
In order to perform it , I created the following job on Jenkins, with the needed plugin added (which is SeleniumHQ htmlsuite Run).
Here is the job:
https://i.stack.imgur.com/6Pm6a.png
The job running has failed,giving the following error which I cant handle.
When I run it, I get the following error :
https://i.stack.imgur.com/hXGmI.png
Any help would be very appreciated
Just tick Delete workspace before build starts box under Build Environment stanza
If you don't have the option in your Jenkins job configuration - make sure that Workspace Cleanup Plugin is installed
If you're running your Selenium tests via Jenkins Pipeline - all you need to do is to put cleanWS() directive somewhere in your pipeline code or Jenkinsfile

Jenkins: Error in Selenium Publish Report

I have properly configured the Seleniumhq plugin into Jenkins. I've also tried to run it in my local Jenkins and it worked. The problems I encounter are as follows:
suiteFile directory reads from C drive ONLY. Example, C:\TestSelenium\testSuite.html
When I try to specify the absolute path to my test suite (workspace), I get the error
The suiteFile is not a file or an url ! Check your build configuration.
Same thing happens with resultFile.
When I add post-build action "Publish Selenium Report," I'm getting an error because the newly created resultFile is saved into C:\TestResult\result.html and not in the workspace.

How to get private executors to communicate with our scm

we are using jenkins-cli for private executors like this:
Command on our private build machine (linux box):
java -jar jenkins-cli.jar -s [cloudbees_url]-i /var/build/.ssh/id_rsa on-premise-executor -fsroot /var/build -labels myLabel -executors 1
But when I kick off a job on this machine, I get a permission denied error in the build:
conq: repository access denied. deployment key is not associated with the requested repository.
fatal: Could not read from remote repository.
Do you know how to add the keys necessary for the build machines to talk to our SCM (We are using BitBucket)
First try running the same commands as the Jenkins job would run, as the user which started the slave.

jenkins error FATAL: Unable to find build script at C:\selenium tests for moveon\moveon4tests1\build.xml

I am using Jenkins and Ant to run my selenium tests. It works fine when I run them on my local machine.
Now I have a Jenkins server which is on a different location and I have to run my tests on that server.
when I tried to run the tests on that server Its is failing because it couldn't find the build.xml file. can you please let me know how can I change the home directory path?
Started by user :**********
Building in workspace /var/lib/jenkins/jobs/moveon4 java tests/workspace
FATAL: Unable to find build script at C:\selenium tests for move\movetests1\build.xml
Build step 'Invoke Ant' marked build as failure
Finished: FAILURE
Are you using "Invoke Ant" in your Jenkins job configuration for the build step that executes your Ant build ? If so, the build file location is hidden away in the Advanced section - it's an annoying quirk of Jenkins.