Pringa
Pringa

Reputation: 91

Unable to find any elements in the url <https://www.predix-ui.com/#/home >

I am trying to automate the [https://www.predix-ui.com/#/home][1] using the Serenity-Js frame work. My Given contains the step to open the URL and When part contains the action items to click on the px-accordin inside Components in Left Menu.

Below is my feature file looks like

Scenario: To identify px-accordoin
  Given access to predix ui
  When i click on px-accordion
  Then i shall automate the expand and collapse

And following is my step file

export =
function identiyPXComponents() {

  this.setDefaultTimeout(120 * 1000);

  const actor = Actor.named("James").whoCan(BrowseTheWeb.using(protractor.browser));

  const stage = serenity.callToStageFor({
    actor: (name) => Actor.named(name).whoCan(BrowseTheWeb.using(protractor.browser)),
  });

  this.Given(/^access to predix ui$/, function () {
    return stage.theActorCalled("James").attemptsTo(
        Start.openApplication()
    );
  });

  this.When(/^i click on px-accordion$/, function () {
    return stage.theActorInTheSpotlight().attemptsTo(PXAccordinComponent.pxAccordinComponent()
    );
  });

  this.Then(/^i shall automate the expand and collapse$/, function () {
    return expect(actor.toSee(Text.of(PXComponentsElements.headerText))).to.eventually.equal("Date And Time");
  });
};

Error i am seeing is : At Given it fails. But i see the URL opening , but then it times out with the following error :

Error: Error while running testForAngular: asynchronous script timeout: result was not received in 110 seconds
       (Session info: chrome=60.0.3112.113)
       (Driver info: chromedriver=2.32.498537 (cb2f855cbc7b82e20387eaf9a43f6b99b6105061),platform=Mac OS X 10.11.6 x86_64) (WARNING: The server did not provide any stacktrace information)
     Command duration or timeout: 110.85 seconds
     Build info: version: '3.4.0', revision: 'unknown', time: 'unknown'
     System info: host: 'C02PQD87G8WP', ip: '3.204.57.13', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.11.6', java.version: '1.8.0_65'
     Driver info: org.openqa.selenium.chrome.ChromeDriver
     Capabilities [{applicationCacheEnabled=false, rotatable=false, mobileEmulationEnabled=false, networkConnectionEnabled=false, chrome={chromedriverVersion=2.32.498537 (cb2f855cbc7b82e20387eaf9a43f6b99b6105061), userDataDir=/var/folders/z8/djc07ncj00v81002xs1wh6sw0000gn/T/.org.chromium.Chromium.IHsjtp}, takesHeapSnapshot=true, pageLoadStrategy=normal, databaseEnabled=false, handlesAlerts=true, hasTouchScreen=false, version=60.0.3112.113, platform=MAC, browserConnectionEnabled=false, nativeEvents=true, acceptSslCerts=true, locationContextEnabled=true, webStorageEnabled=true, browserName=chrome, takesScreenshot=true, javascriptEnabled=true, cssSelectorsEnabled=true, setWindowRect=true, unexpectedAlertBehaviour=}]
     Session ID: 0a67b882a3d3465cc91eb92ef414897d

Unable to proceed further as the code never navigates to When part. I have already tried increasing the time outs.

The same website i am able to automate using a normal protractor-cucumber-typescript framework. But not using Serenity-Js. Kindly provide your insights.

Upvotes: 0

Views: 75

Answers (1)

Jan Molak
Jan Molak

Reputation: 4536

Please have a look at the following answer where I explain how to disable Angular-specific synchronisation when testing non-Angular apps.

Best,

Jan

Upvotes: 0

Related Questions