Below is the java code, which worked for me on appium sever 1.16.0 (need appropriate chrome driver executable for this to work)
ad.findElement(By.xpath("//android.widget.Button[@text=‘XYX’]")).click(); //native app button when clicked on the button chrome browser is launched
forceWait(40000);
ad.activateApp(“com.android.chrome”); //activating the chrome app
ad.getContextHandles(); // getting available contexts
ad.context(“WEBVIEW_chrome”); //switching to webview_chorome content
forceWait(15000);
ad.findElement(By.xpath("//input[@type=‘email’]")).sendKeys("[email protected]");
ad.findElement(By.xpath("//input[@type=‘password’]")).sendKeys(“abcd@1234”);
ad.findElement(By.id(“signInSubmit”)).click();
ad.context(“NATIVE_APP”); //setting context to native app
ad.activateApp(“com.native.app”); //activating the native app
Hello Everyone, Currently, I am using multiremote feature with two capabilities (ios app and chrome browser) defined in webdriverio config file and looking to automate webapp and mobileapp (ios) by adding test cases in the same spec file. 1. First test case opens up browser and click elements 2. second test should open mobile app, click element, enter value. 3. Going back to browser test case again and continue automation. Basis scenario is, like joining zoom meeting where browser client starts meeting and mobile app joins the same meeting. To achieve this switching between browser, mobile, browser views, what would be the best way ? Any inputs please, #webdriverio#appium ? Thanks
I am testing one application through appium.
when I entered mobile number in that Mobile Emulator I got OTP in Web portal ,
So need to grab that OTP from web Portal and need to enter that OTP in mobile application in emulator.
So Can you please help me with code how can I switch app to browser grab that OTP and then come back to app emulator .
In latest version used driver.activateApp("your.app.id"). If you don’t need to return to the active session of the main application.
Or driver.navigate().back() and go back until u get main application active session(repeat it several times, if it’s necessary).