Error: Could not find chromedriver while following angularjs official tutorial - angularjs

At first I have to say this is my first touch with angularjs and node.js so this will be probably a stupid issue, but I want to learn to work with angularjs so I followed this tutorial https://docs.angularjs.org/tutorial and everything went as expected, until I got to Running End to End Tests part.
When I run this command:
npm run update-webdriver
it says:
selenium standalone is up to date.
chromedriver is up to date.
Then I turn on the local server:
npm start
And while its running I run tests:
npm run protractor
which in my terminal results into:
o
Using ChromeDriver directly...
[launcher] Error: Could not find chromedriver at
/home/qw/www/angular-phonecat/node_modules/protractor/selenium/chromedriver.exe
Th file chromedriver.exe really doesnt exists (there is chromedriver_2.10.zip), and I really dont think an .exe file should be there, considering Im using ubuntu 14.04 (this tutorial shoul be for angular version is 1.4.0).
Is this a tuto for some windows version?
Could anyone help me (the way a beginner could understand :) )?

You need to use the webdriver-manager from inside the protractor package:
node_modules/protractor/bin/webdriver-manager update

I was following the tutorial on AngularJS step 3 and had the same issue, but it was caused by missing chromedriver file. I solved it by the following steps:
Go to folder angular-phonecat\node_modules\protractor\selenium to see if you have the following two files:
chromedriver.exe
selenium-server-standalone-2.42.2.jar
If not, download the chromedriver from here: http://chromedriver.storage.googleapis.com/index.html
and the selenium from here:
http://docs.seleniumhq.org/download/
Then put the downloaded files to the angular-phonecat\node_modules\protractor\selenium folder
In the command window, enter npm start to startup the app and in the second command window, enter npm run protractor to run the end to end test with protractor.
Then you will see the lovely Chrome window come up and run the tests.

Related

Why the live server extension is shown the React folders instead of running the code on the browser

image describe my problem
Hi Guys, I had this problem when I launched my React project with Live Server extension. It showed the project's folders instead of running the application. I've removed Live Server extension and reinstalled it but I've got the same issue. When I run it from the terminal with "npm run start" command it works well, please guide me because I read and test solutions being in this link link but it doesn't work.
Try your localhost:3000 or npm start
This is because your React code needs to be compiled. You can run a live server using React with
npm start

How to build and run a reactjs application in Jenkins using batch script

I have installed Jenkins on my local dev machine and I am trying to configure how to build the reactjs application by running 'npm run build' inside a Windows batch command.
When I run the build, it shows that it has changed the path, ran the npm install, even though with some error, but it does not show at all that npm run build has bee executed.
How can I execute that?
I am running Jenkins on Windows Server 2012 and this is the version of jenkins
Jenkins war org.jenkins-ci.main:jenkins-war:2.263.1 The MIT license
Jenkins cli org.jenkins-ci.main:cli:2.263.1 The MIT license
I am not sure what to tell you more. Let me know if you need more information.
A quick note on debugging!
Login to your jenkins machine and perform the same steps.
Let us see if you're able to do so? If yes try the same steps in jenkins windows batch command.
If no then you're doing something wrong with the command.
What do you mean by "it does not show at all that npm run build has bee executed." Do you find the build folder if yes then it's working file. Did you check jenkins build job console? if not pls check out the logs.
I figured it out. The problem was with package.json file. I delete it, deleted the node_modules folder and then I ran:
- npm install
- npm run build
then everything went smooth.
What exactly was wrong with package.json am not sure as it look OK to me.

Error: $compile:tplrt: Cannot render page after compiling AngularJS with WebStorm on Windows

I am currently pretty lost where to start searching for the error that I am facing. The same AngularJS project that my colleagues have been working on for quite a while on Macs cannot be compiled correctly on my Windows machine. No idea if windows and mac has anything to do with the error but just in case I am adding this information.
I've checked out the project with SourceTree and opend it with WebStorm.
First npm install then gulp dev in the terminal of WebStorm and my angularJs-project is beeing compiled without any errors. When then the browser windows with //localhost is beeing opened, the page shows shortly the loading anymation and then stays blank.
In the attached screenshot you can see the output of the console. Any ideas?
AngularJS Version: 1.7.2
NPM Version: 5.6.0
Gulp:
CLI version 3.9.1
Local version 3.9.1
What could make the difference that the project is running perfectly on other machines but not on mine?
[Edit]:
I have now reanimated my old macbook, checked out the exact same project with source tree, installed webstorm, ran npm install, then doing this to set up gulp and then running gulp dev: The App runs just fine.
On my Windows Laptop I've started all over, deinstalled WebStorm, deinstalled node.js and did the whole set up as described above. Only difference that I need to install node.js manually on Windows to use npm.... same error as described before.

Jasmine2 is not a valid framework error

I recently followed a tutorial on running protractor tests inside vs. To my surprise it works however i had to remove jasmine2 as the framework in the conf file or I would get this error
config.framework jasmine2 is not a valid framework.
This is also my first time running the chromedriver through vs and it cannot sendKeys as i was before.
Ex: this.passwordTextField.clear().sendKeys(browser.params.password);
I'm not sure how to get protractor to recognize jasmine2. I have installed jasmine manually also with the --save-dev tag. Protractor is at version 2.5.1
and jasmine is at 2.1.4
Any idea what is going on? Or if there is a better way of running protractor in vs?
I'm using this tutorial which didn't exactly work so I borrowed her sample code and edited that, that worked. Here is the site:
https://misaxionsoftware.wordpress.com/2014/01/30/angularjs-protractor-visual-studio-super-dry/
This error can only happen if protractor <= 1.5.0 is used. Check if tests are executed by the correct protractor executable. FYI, this is where it fails.
For instance, you may have an old globally installed protractor which is used instead of the one installed locally inside project's node_modules.
Or, what I've also seen in practice, the protractor executable located at .bin/protractor was updated by one of the packages that has protractor as a dependency (like grunt-protractor-runner, for instance).

Elementor. How to make it use protractor.conf?

I started adding e2e tests into our project and it seems a few things changed since the last time I used Protractor. For example elementExplorer still useful, but Elementor is way more cooler.
In its the readme is says to launch it by running e.g.: webmanager start and then elementor http://localhost:3000.
But this way it ignores protractor.conf. And since I have a binary path for Chrome browser in that file, along with a logic for clearing cookies and logging into the app in onPrepare function, protractor has to know where the file is. But I can't find a way.
Starting protractor as usual via protractor protractor.conf.coffee and then elementor localhost:3000 not working either. It says "Unable to start a WebDriver session"
Yes, you should launch it by running webdriver-manager start, I use this to run the scripts: protractor script_file_conf.js since I save my scripts as javascript code in my repository. Remember that the conf file should have a reference to the script file.

Resources