Protractor 2.28 - headless Chrome 57 - linux - tests failed - linux

I am trying to run protractor tests with jenkins, but I couldn't get it working.
The tests are started but all fails with one of the following exceptions:
from unknown error: page could not be found: chrome-extension://aapnijgdinlhnhlmodcfapnahmbfebeb/_generated_background_page.html
(Session info: content shell=)
(Driver info: chromedriver=2.28.455506 (18f6627e265f442aeec9b6661a49fe819aeeea1f),platform=Linux 4.4.0-22-generic x86_64)
or
Failed: Error while waiting for Protractor to sync with the page: "window.angular is undefined. This could be either because this is a non-angular page or because your test involves client-side navigation, which can interfere with Protractor's bootstrapping. See http://git.io/v4gXM for details"
The mentioned git issue doesn't help me.
All of them are running well local on a windows 10 machine.
The used versions local and on with jenkins are:
protractor: 5.1.1
chrome: 57.*
chromedriver: 2.28
I have found some issues that chrome should be downgraded to version 55.* but the all didn't solve my problem.
Thank you in advance

It says window.angular is undefined.
I assume it is not an angular site.
Have you tried entering
Browser.ignoreSynchronization = true
Before you get the browser.

Related

Nextjs project stopped working locally all of a sudden

I have been working on a nextjs project locally as I usually do, but all of a sudden, the website stopped working on localhost!
I kept getting this error in the console:
crbug/1173575, non-JS module files deprecated.
System and libraries versions:
OS: Ubuntu 18.04
Node: 14.15.1
Nextjs: 9.5.2
Chrome: 92.0.4515.131 (Official Build) (64-bit)
Firefox: 90.0.2 (64-bit)
start script: NODE_ENV=development node server.js
I have witnessed the same issue on both chrome and Firefox.
I have seen a lot of solutions for this problem, but nothing worked.
After a little debugging and commenting out many parts of the code, I managed to locate the issue.
Basically, it occurs on the backend; not the frontend.
There was an infinite loop that kept responses stuck. Fixing that issue, solved it for me.

vscode on Ubuntu is unable to open windows

I'm having issues with vscode on Ubuntu running particular Python code (that seemingly relies on porting or connecting to an external application). The same code will run fine if I execute it directly from an Ubuntu terminal with the same env on the same machine.
Here's a couple of examples.
When I try to initiate vedo.plotter.Plotter() when running from vscode, I get this error:
ERROR: In /work/standalone-x64-build/VTK-source/Rendering/OpenGL2/vtkXOpenGLRenderWindow.cxx, line 1223
vtkXOpenGLRenderWindow (0x5587f7b42cf0): bad X server connection. DISPLAY=Aborted (core dumped)
If I run the same code directly in terminal, it runs fine, so this is an issue with the way vscode is configured, but I can't find any answers online. I've played with a few settings in vscode but with no success.
This seems to be an issue on all vscode installations I have running on Ubuntu (in this case 20.04). Here's the vscode info:
Version: 1.51.0
Commit: fcac248b077b55bae4ba5bab613fd6e9156c2f0c
Date: 2020-11-05T18:16:10.374Z
Electron: 9.3.3
Chrome: 83.0.4103.122
Node.js: 12.14.1
V8: 8.3.110.13-electron.0
OS: Linux x64 5.4.0-52-generic snap
Similarly, I'm unable to open up browser windows from vscode (for example plotly fig.show() and selenium driver = webdriver.Chrome(chromedriver) won't open browser windows. I get the following error with selenium:
selenium.common.exceptions.WebDriverException: Message: unknown error: Chrome failed to start: exited abnormally.
(unknown error: DevToolsActivePort file doesn't exist)
Again, this works fine direct from the terminal and everything works fine if run from a Windows or Mac installed vscode, so this is specific to this Ubuntu install.
I'd really appreciate any help!
Jonny

WebDriverException: no chrome binary at /usr/bin/google-chrome-stable or chrome binary not found

I am executing selenium test via Jenkins server in AWS Ubuntu.
I was getting chrome binary not found error so I set chrome binary in my code.
System.setProperty("webdriver.chrome.driver","/var/lib/jenkins/.m2/repository/webdriver/chromedriver/linux64/83.0.4103.39/chromedriver");
DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability("applicationCacheEnabled", true);
ChromeOptions options = new ChromeOptions();
options.merge(capabilities);
options.setBinary("/usr/bin/google-chrome-stable");
options.addArguments("--headless");
options.addArguments("--no-sandbox");
options.addArguments("--remote-debugging-port=9222");
options.addArguments("--disable-infobars");
options.addArguments("--disable-dev-shm-usage"); //Linux
options.addArguments("--disable-browser-side-navigation");
options.addArguments("--disable-gpu"); //Windows
options.addArguments("--disable-web-security");
driver = new ChromeDriver(options);
Then the error changed to: no chrome binary at /usr/bin/google-chrome-stable
Starting ChromeDriver 83.0.4103.39 (ccbf011cb2d2b19b506d844400483861342c20cd-refs/branch-heads/4103#{#416}) on port 14665
Only local connections are allowed.
ChromeDriver was started successfully.
INFO [main] (ControlCenter.java:108)- START
[ERROR] Tests run: 4, Failures: 1, Errors: 0, Skipped: 3, Time elapsed: 2.116 s <<< FAILURE! - in TestSuite
[ERROR] com.info.end2end.ExcelAccountToFusion.onTestSetup Time elapsed: 2.032 s <<< FAILURE!
org.openqa.selenium.WebDriverException:
**unknown error: no chrome binary at /usr/bin/google-chrome-stable**
Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:17:03'
System info: host: 'jenkins-it02', ip: '10.113.0.187', os.name: 'Linux', os.arch: 'amd64', os.version: '5.3.0-1019-aws', java.version: '11.0.7'
Driver info: driver.version: ChromeDriver
This is how my usr/bin is:
And this is message when I try to launch browser in command line:
I tried the solution given by #DebanjanB at Cannot find Chrome binary with Selenium in Python for older versions of Google Chrome but no luck. Any help is much appreciated as I have spent 2 days on this already.
Not sure if setBinary() should be pointing to /usr/bin/google-chrome-stable.
As per the documentation in How To Install Google Chrome 78 On a RHEL/CentOS 7 and Fedora Linux to install and use the latest google-chrome using Yum you need to follow the sequence below:
Open the Terminal application. Grab 64bit Google Chrome installer.
Type the following command to download 64 bit version of Google Chrome:
wget https://dl.google.com/linux/direct/google-chrome-stable_current_x86_64.rpm
Install Google Chrome and its dependencies on a CentOS/RHEL, type:
sudo yum install ./google-chrome-stable_current_*.rpm
Start Google Chrome from the CLI:
google-chrome &
Outputs from yum command:
Finally, you need to use the following line to set the chrome binary:
options.setBinary("/usr/bin/google-chrome");
Additional Considerations
Ensure that:
Execute your #Test as non-root user.
Always invoke driver.quit() within tearDown(){} method to close & destroy the WebDriver and Web Client instances gracefully.
Reference
You can find a couple of relevant discussions in:
Cannot find Chrome binary with Selenium in Python for older versions of Google Chrome
I did not have the actual fix for this issue but I could get around my actual blocker by installing Chromium instead of Chrome. Difference I found is the installation directory of both.
I installed Chrome and whereis Google-Chrome-Stable gives:
qa_user#jenkins:~$ whereis google-chrome-stable google-chrome-stable: /usr/bin/google-chrome-stable /usr/share/man/man1/google-chrome-stable.1.gz
And qa_user#jenkins:~$ google-chrome-stable gives: google-chrome-stable: command not found
Now for Chromium:
qa_user#jenkins:~$ whereis chromium-browser gives: chromium-browser: /usr/bin/chromium-browser /usr/lib/chromium-browser /etc/chromium-browser /usr/share/chromium-browser /usr/share/man/man1/chromium-browser.1.gz
and qa_user#jenkins~$ chromium-browser [21304:21304:0607/135202.629230:ERROR:browser_main_loop.cc(1473)] Unable to open X display. Identifies and opens Chromium (X display issue can be solved by adding --headless option in actual Selenium code).
So I am gonna use Chromium instead of Chrome until I/Someone here find the fix for the actual Chrome issue here.
UPDATE:
After my below solution, I uninstalled Chromium and kept only Chrome for further testing. Surprisingly, chrome issue got fixed. I am able to run tests in Chrome now. Not sure how this is happening but I think it has something to do with dependency package that comes with Chrome.
I know this is strange but installing Chrome and Chromium and then uninstalling Chromium worked for me.

protractor appears to interrupt Node when run against Firefox

Background: I am running tests in the Protractor framework against a website written in Angular using Firefox as the browser
The website initially loads with a Server-side render. The follow-up client-side render appears to get interrupted. Angular is available, but nothing in the Dom loads.
Asking Google hasn't helped(none of the Stackoverflow results appeared to be relevant). Didn't see any open issues or closed issues on the Protractor github which appeared to be relevant
I'm not sure what's relevant to the investigation, so starting information:
Firefox version: 65
geckodriver version: v0.24.0 [last]
protractor version: 5.4.1
framework: jasmine
directconnect = true
Has anyone resolved this issue before? Is there additional information which would be relevant. What have I missed? The same tests running against Chrome pass without issue

Selenium WebDriver Firefox connect error for Linux OS

I have tried all solution suggested by Google. But still struggling to below issue. I have setup of PHPUnit-Selenium based automation framework using headless Firefox on RedHat Linux
Selenium Log Error :
Caused by: org.openqa.selenium.WebDriverException: Failed to connect
to binary FirefoxBinary(/usr/bin/firefox) on port 7055; process output
follows: Error: no display specified Error: no display specified
So far I tried:
updated version of selenium driver
updated version of firefox
various selenium-firefox combinations using older versions
Xvfb working fine
Please also let me know :
How i can verify firefox on port 7055 ?
Is etc/hosts file can have cause of this issue ?

Resources