1
votes

getting a few issues with protractor when running my E2E tests. Firstly I should let you know these tests pass perfectly on my local macghine, the errors occur when I put them onto a Jenkins server. Below is a little snippet of what is failing.

describe('Small screen tests', function() {
beforeAll(function() {
  browser.get(browser.params.underTestUrl);
  homeView.setBrowserSize('small');
  loginView.login();
  homeView.nav();
});

afterAll(function() {
  homeView.nav();
  loginView.logout();
});

it('should see at least one financial period on the Financial Periods view', function() {
  page.settlementBtn.click();
  page.financialPeriodsBtn.click();
  expect(page.financialPeriods.count()).toBeGreaterThan(0);
});

Protractor (on Jenkins) throws this error ->

[31m Failed: unknown error: Element is not clickable at point (-160, 324) [chrome #1-1] (Session info: chrome=47.0.2526.106) [chrome #1-1] (Driver info: chromedriver=2.20.353124 (035346203162d32c80f1dce587c8154a1efa0c3b),platform=Linux 3.10.0-327.3.1.el7.x86_64 x86_64)[0m [chrome #1-1] Stack: [chrome #1-1] UnknownError: unknown error: Element is not clickable at point (-160, 324) [chrome #1-1] (Session info: chrome=47.0.2526.106) [chrome #1-1] (Driver info: chromedriver=2.20.353124 (035346203162d32c80f1dce587c8154a1efa0c3b),platform=Linux 3.10.0-327.3.1.el7.x86_64 x86_64) [chrome #1-1] at process._tickCallback (node.js:368:9)

The answer is right in front of me but what is baffling me is how this test can pass locally but not on a Jenkins server. Have you come across this problem before and if so, how did you overcome it?

1

1 Answers

2
votes

Selenium, and by extension Protractor, is not "allowed" to interact with elements that a human would not be able to interact with. Therefore, Element is not clickable at point (-160,324) makes sense.

What appears to be happening is that your browser may be smaller or shrunken on the Jenkins server and the element you are trying to interact with has gone off the visible window. This is likely something you have not experienced on your local machine with a larger viewing area.