The requested command matched a known URL but did not match any method for that URL.
Hello guys.
I have a problem in a test swipe for App Android, always what run this test, is return that error: “ERROR webdriver: Request failed with status 405 due to unknown method: Not implemented”. And I’ve already been in some forums and nothing. Please, can someone help me?
My capabilities:
"default-capabilities": {
"platformName": "Android",
"appium:platformVersion": "13",
"appium:deviceName": "AppiumAVD",
"appium:deviceOrientation": "portrait",
"appium:automationName": "UiAutomator2",
"appium:appPackage": "com.wdiodemoapp",
"appium:appActivity": "com.wdiodemoapp.MainActivity"
},
Versions:
- Node: 18.0.0
- Appium: 2.2.1
- WebdriverIo: 8.21.0
Language:
- JavaScript
Code:
it('Should be able to swipe horizontally', async () => {
// Elemento alvo para verificar após o swipe
const targetElement = await $('//android.widget.TextView[@text="GREAT COMMUNITY"]');
// Obtenha a posição inicial e final para o swipe
const startX = 0.8; // Porcentagem da largura da tela
const endX = 0.2; // Porcentagem da largura da tela
const y = 0.5; // Porcentagem da altura da tela
const { height, width } = await driver.getWindowSize();
// Calcula as coordenadas reais
const startCoords = { x: width * startX, y: height * y };
const endCoords = { x: width * endX, y: height * y };
// Realiza o swipe
await driver.touchPerform([
{ action: 'press', options: startCoords },
{ action: 'wait', options: { ms: 1000 } }, // Pode ajustar o tempo conforme necessário
{ action: 'moveTo', options: endCoords },
{ action: 'release', options: {} },
]);
// Verifica se o elemento alvo está visível após o swipe
const isTargetVisible = await targetElement.isDisplayed();
assert.isTrue(isTargetVisible, 'O swipe horizontal falhou ou o elemento alvo não está visível após o swipe');
});