Issue in Appium Testcases execution in firefox browser
PriyankaKeer opened this issue · 1 comments
The problem
Issue in Appium Testcases execution in firefox browser
Environment
- Appium version (or git revision) that exhibits the issue: 1.20.2
- Last Appium version that did not exhibit the issue (if applicable):NA
- Desktop OS/version used to run Appium: Windows 10
- Node.js version (unless using Appium.app|exe): 6.14.8
- Npm or Yarn package manager: npm
- Mobile platform/version under test: R(API 30)
- Real device or emulator/simulator: Emulator
- Appium CLI or Appium.app|exe: Appium CLI
Details
Unable to execute appium testcases in Firefox browser, though installation of firefox browser is done in emulator and desired capabilities are mentioned.
Link to Appium logs
[debug] [WD Proxy] Matched '/status' to command name 'getStatus'
[debug] [WD Proxy] Proxying [GET /status] to [GET http://127.0.0.1:5200/status] with no body
[WD Proxy] connect ECONNREFUSED 127.0.0.1:5200
[debug] [WD Proxy] Matched '/status' to command name 'getStatus'
[debug] [WD Proxy] Proxying [GET /status] to [GET http://127.0.0.1:5200/status] with no body
[debug] [WD Proxy] Got response with status 200: {"value":{"message":"","ready":true}}
[debug] [WD Proxy] Matched '/session' to command name 'createSession'
[debug] [WD Proxy] Proxying [POST /session] to [POST http://127.0.0.1:5200/session] with body: {"capabilities":{"firstMatch":[{}],"alwaysMatch":{"browserName":"firefox","platformName":"moz:firefoxoptions"}}}
[WD Proxy] Got response with status 500: {"value":{"error":"session not created","message":"Unable to find a matching set of capabilities","stacktrace":""}}
[debug] [W3C] Matched W3C error code 'session not created' to SessionNotCreatedError
[GeckoDriver] Ending Gecko Driver session
[GeckoDriverServer] geckodriver.exe has exited with code null, signal SIGTERM
[debug] [BaseDriver] Event 'newSessionStarted' logged at 1617605896466 (12:28:16 GMT+0530 (India Standard Time))
[debug] [MJSONWP] Encountered internal error running command: SessionNotCreatedError: A new session could not be created. Details: Unable to find a matching set of capabilities
[debug] [MJSONWP] at errorFromW3CJsonCode (C:\Users\XXX\AppData\Roaming\npm\node_modules\appium\node_modules\appium-base-driver\lib\protocol\errors.js:780:25)
[debug] [MJSONWP] at ProxyRequestError.getActualError (C:\Users\XXX\AppData\Roaming\npm\node_modules\appium\node_modules\appium-base-driver\lib\protocol\errors.js:663:14)
[debug] [MJSONWP] at GeckoProxy.command (C:\Users\XXX\AppData\Roaming\npm\node_modules\appium\node_modules\appium-base-driver\lib\jsonwp-proxy\proxy.js:273:19)
[debug] [MJSONWP] at processTicksAndRejections (internal/process/task_queues.js:93:5)
[debug] [MJSONWP] at GeckoDriverServer.start (C:\Users\XXX\AppData\Roaming\npm\node_modules\appium\node_modules\appium-geckodriver\lib\gecko.js:185:5)
[debug] [MJSONWP] at GeckoDriver.createSession (C:\Users\XXX\AppData\Roaming\npm\node_modules\appium\node_modules\appium-geckodriver\lib\driver.js:59:7)
[debug] [MJSONWP] at AppiumDriver.createSession (C:\Users\XXX\AppData\Roaming\npm\node_modules\appium\lib\appium.js:371:35)
[HTTP] <-- POST /wd/hub/session 500 1224 ms - 143
[HTTP]
Code To Reproduce Issue [ Good To Have ]
Firefox is installed in Emulator but executing Appium testcases in Firefox browser is creating the above issue.
Please remember that with sample code it's easier to reproduce the bug and it's much faster to fix it.
public class TestCase1Firefox {
static WebDriver driver;
DesiredCapabilities capabilities;
@before
public void setUp() throws MalformedURLException{
capabilities= new DesiredCapabilities();
capabilities.setCapability(CapabilityType.BROWSER_NAME, "firefox");
capabilities.setCapability("platformName","Android");
capabilities.setCapability("automationName","Gecko");
JSONObject proxyobj=new JSONObject();
proxyobj.put("androidPackage","org.mozilla.firefox");
proxyobj.put("androidDeviceSerial", "emulator-5554");
capabilities.setCapability("moz:firefoxOptions",proxyobj);
capabilities.setCapability("deviceName","sdk_gphone_x86");
capabilities.setCapability(CapabilityType.VERSION, "11");
}
@test
public void testCal() throws Exception {
driver = new RemoteWebDriver(new URL("http://127.0.0.1:4723/wd/hub"), capabilities);
driver.get("https://www.amazon.com");
System.out.println("INSIDE TEST METHOD");
}
@After
public void teardown(){
//close the app
driver.quit();
}
}
Thanks in Advance!
Closed as duplicate