0

I am working on an AngularJS app, and want to get Protractor up and running with it, to use for testing the front end user interaction automatically.

The way my development environment is set up, is that I am doing the front-end development on my local Windows desktop, and running grunt on a CentOS 7 VM to serve the front-end of the application.

I have used Unix systems a bit in the past, but predominantly just for a couple of modules I took at university a few years ago, so don't have that much experience with them.

When I joined this company, I started working with the practises that they already had in place. Day-to-day, my use of the Unix VM is simply:

  1. Start it up
  2. Open a couple of terminals
  3. Become root (su -)
  4. Run python (python3.4 -m myApp start)
  5. Run grunt serve from the appropriate location, to serve the front end

I am following the tutorial at: http://www.protractortest.org/#/tutorial to try and get Protractor up and running to use it as a testing framework within my development environment, and have done the first couple of steps of the setup without any problems:

npm install -g protractor

webdriver-manager update

When I then try to run the next command: webdriver-manager start, I get an error that says:

'java' is not recognized as an internal or external command, operable program or batch file.

[11:24:04] I/start - Selenium Standalone has exited with code 1

I assume that this means that Java is not installed on the VM, and will need to be in order to run the command webdriver-manager start?

I downloaded the JRE for linux x64 (.rpm file) from Oracle, and copied it to the desktop of my VM. I am now following the instructions at Linux Java installation to install Java on the VM, but am having a bit of trouble doing so...

I have followed the steps:

  1. Become root
  2. Change to the directory in which you want to install
  3. Install the package: `rpm -ivh jre-8u144-linux-x64.rpm

but when I run this last command, to install the package, the console shows an error that says:

open of jre-8u144-linux-x64.rpm failed: No such file or directory

If I run ls from the terminal where I am logged in as root, I can't see any of the files on the Desktop (which is my current location), but if I run ls from another terminal where I'm not logged in as root, I can see all of the files on the desktop, including the jre-8u144-linux-x64.rpm file that I'm trying to install...

So why is it that the root user can't see the .rpm file that I want to install, even though the 'normal' user can...? I tried installing the JRE from the 'normal' user by running the command in that terminal, but obviously got an error stating that I didn't have the permissions to do this:

error: can't create transaction lock on /var/lib/rpm/.rpm.lock (Permission denied)

How can I install the JRE that I need in order to use this testing framework on my VM?

  • Can you please run pwd in the directory where you are root, and also in the directory where you can see the file? – mattdm Sep 20 '17 at 13:00
0

as I've seen in the first paragraph to become root you type su - which reinitializes your environnement when you change user. So when becoming root you change your PWD environnement variable, and so changes the current directory you are in, and it becomes /root.

There are two ways of solving your issue

  • First one :
    use su instead of su -, you will be in the same directory as with your regular user. So after becoming root you'll be able to type rpm -ivh jre-8u144-linux-x64.rpm

  • Second one:
    when you're in the right directory with your regular user you type pwd and note that path somewhere. Should be something like /home/user/something Then you type su - and then execute rpm -ivh /home/user/something/jre-8u144-linux-x64.rpm. That should work.

Both of them should work, I would recommend the second one though.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.