1

On my local, I start e2e tests in Protractor and this is good. I have problem when I want start tests on Jenkins job.

  • I pull tests from repo
  • run command npm install
  • run command node_modules\.bin\ng e2e --webdriver-update

My tests start execution and I have problem:

` W/element - more than one element found for locator by.buttonText("Create") - the first result will be used
[31m× Check Item in RAID Type drop-down-menu[39m
  [31m- [39m[31mFailed: element not interactable
    (Session info: chrome=69.0.3497.81)
    (Driver info: chromedriver=2.42.591088 (7b2b2dca23cca0862f674758c9a3933e685c27d5),platform=Windows NT 6.2.9200 x86_64)[39m
    (Session info: chrome=69.0.3497.81)
    (Driver info: chromedriver=2.42.591088 (7b2b2dca23cca0862f674758c9a3933e685c27d5),platform=Windows NT 6.2.9200 x86_64)
      at Object.checkLegacyResponse (C:\Program Files (x86)\Jenkins\workspace\newJob\NewGenProject\ui\node_modules\selenium-webdriver\lib\error.js:546:15)
      at parseHttpResponse (C:\Program Files (x86)\Jenkins\workspace\newJob\NewGenProject\ui\node_modules\selenium-webdriver\lib\http.js:509:13)
      at doSend.then.response (C:\Program Files (x86)\Jenkins\workspace\newJob\NewGenProject\ui\node_modules\selenium-webdriver\lib\http.js:441:30)
      at <anonymous>
      at process._tickCallback (internal/process/next_tick.js:189:7)`
2
  • As per error details, it is specific to an element.Does it mean browser launches successfully ? Sep 20, 2018 at 7:51
  • Also before this step ,does automation interacts with any other element successfully? If so, then it's simply a case of element not interactable.Nothing specific to Jenkins. Sep 20, 2018 at 7:54

2 Answers 2

1

Assuming browser launches successfully and test is able to interact with any other element successfully before the element having issues.

Use explicit wait for the desired element as below:

browser.wait(ExpectedConditions.visibilityOf($('NON-EXISTING-ELEMENT')), 3000, 'error message')

As it seems that element is not ready yet for interaction.Also if you share the code & relevant html snippet as well , then all might be able to suggest better solutions.

2
  • Thanks for answer. All my code work work fine in my local machine. And when I start my code on Jenkins job, I have problem. Element not interactable.
    – Lee Ji
    Sep 20, 2018 at 8:46
  • What are the specifics? Where is your code? Relevant html source? Jenkins job details?It is hard for anybody else to help you without further information. Sep 20, 2018 at 8:50
0

this is my Protractor code.

it('Creating default configuration ', () => {
        _home.getPowerConfiguration().click();

        _descriptionModel.buttonStartCreate().click();
        for (let i = 0; i < 4; i++) {
            _wizard.buttonNext().click();
        }
        _descriptionModel.buttonCreate().click();
        expect(_configuration.geImage().isDisplayed()).toBe(true).then(function (result) {
            expect(_configurationView.getNebu().count()).toBe(2);
            expect(_configurationView.getimage().count()).toBe(2);
            expect(_configurationView.getImage().isDisplayed()).toBe(true);
        });
    });

This is work on my local machine, but does not on Jenkins.

1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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