2

i got the error:

2022-07-31T14:09:08.666Z ERROR webdriver: Request failed with status 404 due to unknown command: The requested resource could not be found, or a request was received using an HTTP method that is not supported by the mapped resource

And this happens everytime i tried to use the type function in codeceptjs, i've tried use fillField funciton but after fill the field the button is not enable.

My code:

const { I } = inject();

module.exports = {

  tabs:{
    CPFouEmail: "#tabCpf"
  },

  campos:{
    cpf: "#cpf",
    senha: "#senha"
  },

  botao:{
    continuar: "//android.widget.Button[@text='Continuar']"
  },

  fazerLogin(CPF, senha){
    I.waitForElement(this.tabs.CPFouEmail,5)
    I.tap(this.tabs.CPFouEmail)

    I.waitForElement(this.campos.cpf,5)
    I.tap(this.campos.cpf)
    //I.fillField(this.campos.cpf, CPF)
    I.type(CPF)
    
    I.waitForElement(this.botao.continuar,5)
    I.tap(this.botao.continuar)

    I.waitForElement(this.campos.senha,5)
    I.tap(this.campos.senha)
    //I.fillField(this.campos.senha, senha)
    I.type(senha)

    I.waitForElement(this.botao.continuar,5)
    I.tap(this.botao.continuar)
  }
}

--verbose mode

[1] Error | unknown command: The requested resource could not be found, or a request was received using an HTTP method that is not supported by the mapped resource
    [1] Error | unknown command: The requested resource could not be found, or a request was received using an HTTP method that is not supported by the mapped resource
    [1] Error | unknown command: The requested resource could not be found, or a request was received using an HTTP method that is not supported by the mapped resource
    [1] Error | unknown command: The requested resource could not be found, or a request was received using an HTTP method that is not supported by the mapped resource
    [1] Error | unknown command: The requested resource could not be found, or a request was received using an HTTP method that is not supported by the mapped resource
    [1] Error | unknown command: The requested resource could not be found, or a request was received using an HTTP method that is not supported by the mapped resource
    [1] Error | unknown command: The requested resource could not be found, or a request was received using an HTTP method that is not supported by the mapped resource
    [1] Error | unknown command: The requested resource could not be found, or a request was received using an HTTP method that is not supported by the mapped resource
    [1] Error | unknown command: The requested resource could not be found, or a request was received using an HTTP method that is not supported by the mapped resource
    [1] <teardown> Stopping recording promises
 » <screenshotOnFail> Test failed, try to save a screenshot
 » Screenshot has been saved to C:\Users\felip\OneDrive\Documentos\AppVivo\output\Login_com_sucesso.failed.png
  × FAILED in 5943ms

    [2]  Starting recording promises

-- FAILURES:

  1) Login
       Login com sucesso:
     The requested resource could not be found, or a request was received using an HTTP method that is not supported by the mapped resource
      at getErrorFromResponseBody (node_modules\webdriver\build\utils.js:198:12)
      at NodeJSRequest._request (node_modules\webdriver\build\request\index.js:166:60)
      at processTicksAndRejections (node:internal/process/task_queues:96:5)
      at async Browser.wrapCommandFn (node_modules\@wdio\utils\build\shim.js:137:29)
      at async Browser.wrapCommandFn (node_modules\@wdio\utils\build\shim.js:137:29)
      at async Appium.type (node_modules\codeceptjs\lib\helper\WebDriver.js:1895:5)

0 Answers0