by

Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Jan 31 2019 19:00
    tfaron commented #5133
  • Jan 31 2019 07:28
    cnishina closed #5135
  • Jan 31 2019 07:28
    cnishina commented #5135
  • Jan 30 2019 16:23
    ThabisoGithub closed #5136
  • Jan 30 2019 16:23
    ThabisoGithub edited #5136
  • Jan 30 2019 16:23
    ThabisoGithub edited #5136
  • Jan 30 2019 16:21
    ThabisoGithub opened #5136
  • Jan 30 2019 16:18
    IgorSasovets commented #4177
  • Jan 30 2019 15:05
    andrewchan-clover commented #4177
  • Jan 30 2019 13:43
    IgorSasovets commented #5135
  • Jan 30 2019 12:37
    EnzDev edited #5125
  • Jan 30 2019 11:47
    akshaymondal opened #5135
  • Jan 29 2019 14:33
    uinest commented #4822
  • Jan 28 2019 21:38
    cnishina commented #5132
  • Jan 28 2019 21:37
    cnishina commented #5134
  • Jan 28 2019 21:37
    cnishina closed #5134
  • Jan 28 2019 21:36

    cnishina on selenium4

    chore(release): bumpb version t… (compare)

  • Jan 28 2019 11:30
    think4ideas opened #5134
  • Jan 28 2019 11:01
    toniedzwiedz commented #2735
  • Jan 28 2019 09:42
    azorrozua commented #4786
Dzanan91
@Dzanan91
okay let me try that
Thanks
Aasim Anwar
@aasimali
Hi, Would like to know that, can we automate a PDF loaded in browser using Protractor?
hfsoares
@hfsoares
Hello guys, I need some debugging tips. I am using Angular 8, and Google Chrome 80.x.x.x.x
I have a test that logs in the system, by sendKeys for login and password, press a button, and then try to fill 2 more form fields, name and description also with sendKeys.
The script goes well until the last description field, when it freezes.
I have switched the order, filling description first, and the system freezes at the name. So, it seems that my finder is correctly designed.
I am using async and await pattern
Thomas
@selenium4466_gitlab
@hfsoares could you post snippet of code
hfsoares
@hfsoares
Sure
navBarGrupos = new NavBarGrupos();
await navBarGrupos.clickOnCrieNovoGrupo();
grupoUpdatePage = new GrupoUpdatePage();
grupoCabecalhoPage = new GrupoCabecalhoPage();
await grupoUpdatePage.setNomeInput('nome'),
await grupoUpdatePage.setDescricaoInput('descricao')
this is the test.spec (the names are in portuguese)
this is the page finder elements
editForm = element(by.name('editForm'));
nomeInput = this.editForm.element(by.id('field_nome'));
descricaoInput = this.editForm.element(by.id('field_descricao'));
I have tried whitout the editForm, and it behaves the same way
async setNomeInput(nome: string): Promise<void> {
await this.nomeInput.sendKeys(nome);
}
this is the "typer"
Thomas
@selenium4466_gitlab
async setNomeInput(nome: string): Promise<boolean> { await this.nomeInput.sendKeys(nome).then(()=>{ }); }
await grupoUpdatePage.setNomeInput('nome').then(async (value)=>{ await expect(value).toBe(true) });
hfsoares
@hfsoares
I will try that... but why would work?
Thomas
@selenium4466_gitlab
@hfsoares also check element the one you performing an action on
hfsoares
@hfsoares
check?
Thomas
@selenium4466_gitlab
inspect the element the one it freezes
make sure its correct one
hfsoares
@hfsoares
oh, yes, it is te correct one. If I swith the order, then it will be ok
Thomas
@selenium4466_gitlab
is the website public domain or under company proxy?
hfsoares
@hfsoares
company proxy.
.then(async (value)=>{ await expect(value).toBe(true) }); this part here doesn't work, because expect(value).toBe(true) it is not a promise
Thomas
@selenium4466_gitlab
@hfsoares I see in that case its hard to tell what could be a wrong with it
hfsoares
@hfsoares
nobody is complainng about chrome 80? I have just updated
I can share my screen with you.
Thomas
@selenium4466_gitlab
drivers were updated to version 80, which means make sure you have node above 10.15.1 and webdriver-manager 12.7.1 min
also make sure you chrome browser also updated to 80
screenshot would definately help
hfsoares
@hfsoares
node is v12
my browser is 80
let me check the webdriver
Thomas
@selenium4466_gitlab
are you running webdriver-manager update before
hfsoares
@hfsoares
webdriver is 12.1.7
it is the latest
hfsoares
@hfsoares
would you join me in skype?
Vladimir Pozdniakov
@Vladimir-Pozdniakov
Hi guys. I need to replace one of the server responses in my e2e test. How can I do it with Protractor?
Luke
@luker2
@Vladimir-Pozdniakov I've never got it working, but it seems like I've heard of people spinning up a proxy server within protractor's onPrepare function. I assume from there you could capture/modify the traffic going in/out
nunofreitasbotelho
@nunofreitasbotelho

This is my PO:

getTableHeaders() {
    const tableHeaders = [];
    element.all(by.css('.mat-header-cell button')).then(elements => {
      elements.forEach(el => {
        el.getText().then((header: string) => {
          console.log(header);
          tableHeaders.push(header.toUpperCase());
        });
      });
    }).then(() => {
      return tableHeaders;
    });
  }

cant i return the array?

I'm not able to get the array on the test
hfsoares
@hfsoares
@selenium4466_gitlab , I have figured it out!!! Your tips helped me a lot.
So basically, my tests were freezing with a scriptTimeOut error, trying to fill the second field on a page of my angular 8 app.
Now that I understand the synchronize design of protractor, I have inspect the zone, for tasks scheduled. Thist question from stack was really helpful: https://stackoverflow.com/questions/48627074/how-to-track-which-async-tasks-protractor-is-waiting-on?rq=1
So, in the end, it was the matomo.js. Matomo is an open source analytics tool. And it schedule a lot of tasks to get analytics info. It was just a matter of disabling it when testing, and the problem is gone
Luke
@luker2
getTableHeaders () {
    return element.all(by.css('.mat-header-cell button')).each(el => {
        return el.getText().then(header => header.toUpperCase());
    });
}
@nunofreitasbotelho this version may be slightly neater (I didn't test it)
Your return is only recognized by your .then(), the outer function getTableHeaders() can't see that. To fix your version, you could add a return before element.all
Luke
@luker2

also, appears you're using typescript. If you defined your return type in the function signature, it would have pointed out your problem early :)

getTableHeaders (): promise.Promise<string[]> {

nunofreitasbotelho
@nunofreitasbotelho
Thank you, i had figured the missing returns already
Guess i'm not good at protractor and at typescript
atm its trial and error
Luke
@luker2
looked better than mine would have starting out :)
Ghouse Mohiddin
@PlaxoGhouse
Hi, Any one have any suggestions/workaround for the below error
NoSuchSessionError: This driver instance does not have a valid session ID (did you call WebDriver.quit()?) and may no longer be used.