Open susmifun opened 4 years ago
This can be caused by a number of issues in my experience:
Thanks Lyubomir Aleksiev for looking into this.
when I used .then() with my Browser.get (), shouldn't this mean that the page is completely loaded and then executes the code block?
browser.get("myURL").then(() => { console.log('begin code block'); expect( myElement.isPresent()).toBe(true); expect(myElement.link.isDisplayed).toBe(true); myElement.link.click(); myElement.Input.sendKeys('UserName'); console.log('End code block'); } Expected Output: Element will be clicked and .sendKeys will be executed.
Actual Output: code block is not getting executed 50% of the times. Only the console statements are being executed.
My E2E test is loading a web page and trying to click on element and then enter a value in the text box.
The test passes only 50% of the time. Other times, test complains that the element click is intercepted. Basically the test times out without performing the clicks. Unless user interacts with the web page, then test executes line by line. The code works, but i want to know what should I be doing to get all lines of code executed (100% of the time) without any user interaction.
describe('Enter value test suite', () => { using(SCENARIOS.DEVICE_SCENARIOS, ({device}) => { describe('signedInuser',() => { beforeAll(() => { /// setWindowSize(device); } afterEach(() => { page = null; id = null; browser.executeScript('window.sessionStorage.clear(); window.localStorage.clear();'); }); beforeEach(() => { form= {//test data name: 'User'; lname: 'lname'; } } it(
Should load page for users with ${scenario.params} vt on a ${device} device
,() =>{ loadmyPage(0,scenario.params); expect( myElement.isPresent()).toBe(true); expect(myElement.link.isDisplayed).toBe(true); myElement.link.click(); myElement.Input.sendKeys('UserName'); } } }Node Version:
v6.9.0
Protractor Version:
"^5.4.0
Angular Version:
1.5.11
Browser(s):
Chrome
Operating System and Version Session info: chrome=83.0.4103.106 Driver info: chromedriver=83.0.4103.39 (ccbf011cb2d2b19b506d844400483861342c20cd-refs/branch-heads/4103@{#416}), platform=Mac OS X 10.15.4 x86_64
Your protractor configuration file
A relevant example test
Output from running the test
Steps to reproduce the bug Test passes only 50% of the time.
The URL you are running your tests against (if relevant)