mercredi 15 janvier 2020

Protractor test: Is it able to block/freeze the DOM during test execution?

I'm executing the Protractor test in angular web application.

Test Case:

  1. Find elements in the list

  2. Loop through every element in the list

  3. If element containing needed name

  4. Click at the element

Code:

let projectsList = await element.all(by.css(Selectors.projectList));
        for (item of projectsList) {
            item.getText().then((text) => {
                if (text.includes("50_projects_to_tests")) {
                    console.log(text)
                    item.clik()

                }

            }, (err) => console.log(err));
        }

Problem:

Test case is straightforward to execute except one thing.

Request about updating information in the project is sending every few second. When the response back from the server I'm loosing selected list of project before.

It's mean that I'm not able to click at the element which I found because this element does not longer exist.

I receiving: StaleElementReferenceError: stale element reference: element is not attached to the page document

Question:

Is it able to block/freeze the DOM while the test is executing?

Any ideas would be appreciable to handle the issue.

Aucun commentaire:

Enregistrer un commentaire