Protractor Chrome angular could not be found on the page - angularjs

I have had E2E tests set up to run in Chrome for a while, however they no longer work. I'm not sure when they stopped working as they've been neglected. The project uses grunt-protractor-runner (2.1.2) which uses protractor 2.5.1
I get the following error:
Uncaught exception: Error while waiting for Protractor to sync with the page: "angular could not be found on the window"
Below is screenshot of the output:
It actually opens up Chrome , however doesn't navigate anywhere. The omnibox says "data:," and nothing else:
One thing I'm wondering, is that chrome got somewhat locked down - and the omni box doesn't work as a google browser now - but I don't see why that would affect it as it should hit a URL directly.
Can anyone advise please?

Typically this error happens in one of two ways:
There is a race condition where protractor wants to start the tests before the page is fully loaded. In this case, make sure that your onPrepare function in your protractor conf returns a promise that gets resolved once all preparations work.
The test does not navigate to the app's url. In this case, make sure that you run `browser.get();
There is an error trying to start your app. This one's a little harder to fix. You can try running the protractor element explorer and see if there's an error in the browser console.

Ive seen this problem a few times myself. The last time I fixed it was by updating to the latest version of chrome driver and the latest version of protractor. Certain earlier combinations of chrome driver and protractor can cause this problem.
Grunt protractor runner can be used with latest versions of protractor according to its documentation. I suggest having a little read of how to update to the latest versions?

Related

VS Code React app closes/crashes using Chrome debugger

I am troubleshooting an issue I am having debugging a React application using VS Code with the Chrome debugger extension. I am using Windows 10 x64.
When I try to log into the application from the app's login page, the debug browser closes without any error (see screenshot below of break-point in code where the browser closes/crashes). I've tried debugging with both Chrome and Edge and I see the same issue with both browsers.
I do not have the same issue running the application without debugger from npm start. Nor do I see the issue when running the application from Chrome debugger on a different computer. Also my friend who is working on the same code does not see the issue on his computer when debugging or running the code.
I cloned an extra copy of the application code onto a different directory on my computer and that did not fix the issue.
I see a file is created \src\debug.log which seems like it could be related to the issue, but not sure what this is used for. The log file just shows the below error over and over.
ERROR:crash_report_database_win.cc(469)] failed to stat report
Any ideas on how I can fix this or what might be happening here?
I faced with the same issue in the Chrome version 85, I've updated to version 86.0.4240.75 and now is working for me
Here you'll find the Chrome Bug Report: https://bugs.chromium.org/p/chromium/issues/detail?id=1123329
The solution for now is to disable the new Javascript Debugger
"debug.javascript.usePreview": false

Sencha Studio tests on Windows 10 neither run in IDE nor via CLI

I'm new to Sencha and so for Sencha Test. On my Windows 10 machine I installed the latest Sencha Studio and imported a sample project for ours. Following tutorials I created a test suite with the sample "it should pass 1 = 1" test. But I cannot run this test, neither via IDE nor CLI.
On the scenario I selected my local Chrome browser and the sample test. When I click on RUN, the browser selection on the right gets updated with gray bullets or void but nothing else happens. Changing the scenario's test type to "Webdriver" or "In-browser" does not change anything in regard for the outcome.
I also tried to execute the test via CLI but no success either. I always end up with this message: "Sencha Test v2.0.2Error: Sencha Cmd install directory not found : C:\Users[MY_PROFILE]\bin\Sencha\Cmd." That's right, my Sencha Cmd installation is located in C:\dev\Sencha\Cmd and works properly. Where's the configuration to change that stc can find Sencha Cmd?
Any hints how to get the tests run? Is an archive server mandatory to run the tests? Is there anything that I might have missed? Using Google was no help so far.
Maybe that's helpful: The Event Recorder does also not work properly. When I click on recording, my Chrome does not get opened, I have to open it by myself and navigate to the URL provided by Sencha Studio. Weird.
Thanks in advance.
After several hours of thinking and searching I think the most critical error was to NOT install Sencha Cmd and Sencha Test into the installer's recommended folder. I still have issues when starting tests but I'll post an answer if there's anything interesting about this topic.
Also, it seems that Sencha Test always expects that a built project exists. So just checking out the sources without building them is not sufficient to run tests, even if you're testing e.g. the staging.

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).

How to run protractor using browserify?

Can anyone tell me how to run protractor using browserify? I have prepared bundle.js file. But I don't know how to execute command 'protractor protractor-config.js' in browser console. It is undefined in browser console.
As far as I know, you aren't going to be able to do this. Protractor is a Node.js application, to say nothing of its requirement for Selenium. It uses Node to execute, not the browser.

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