Closed ygarg465 closed 5 months ago
Hey @sudharsan-selvaraj, did you look at this issue? Because it's a blocker for me to move forward.
@ygarg465 Are you using webdriver.io on the client side?
@sudharsan-selvaraj Actually yes
@ygarg465 Could you please try with the below syntax?
await driver.execute("interceptor: addMock", {
config: {
url: "https://domain/sms/sendOTP",
method: "POST",
responseBody: JSON.stringify({
success: true,
message: "OTP sent successfully",
}),
},
});
@sudharsan-selvaraj Yes this syntax resolves the above issue. Was this due to WebDriver ? If Yes we can update the docs to add this usecase as well.
However now I am getting this error in logcat when the request is sent from the app.
[ERROR:ssl_client_socket_impl.cc(970)] handshake failed; returned -1, SSL error code 1, net_error -202
Failed to validate the certificate chain, error: java.security.cert.CertPathValidatorException: Trust anchor for certification path not found.
@sudharsan-selvaraj Addtional context It's a hybrid application developed using CapacitorJS
I should create a separate issue for that.
Describe the issue Mocking request using below code
results in this error on Appium server logs
invalid argument: Did not receive an appropriate execute method parameters object. It needs to be deserializable as a plain JS object
This also happens if we pass an empty object or the example code in the commands sections
Device Information OS: Android Version: API 34 (Android 14) Device: Pixel 7 Pro