appium / java-client

Java language binding for writing Appium Tests, conforms to W3C WebDriver Protocol
Apache License 2.0
1.2k stars 755 forks source link

Simulator shows Black screen during execution if it is already opened before the run. #1190

Open aruvimal opened 5 years ago

aruvimal commented 5 years ago

Description

i having issue in Xcode simulator which shows Black screen always if simulator is already opened, though i have already set fullrest as True. I know the app does run because I can see the output in the Debug Area at the bottom and it is as expected.

(this issue happens when simulator is not quite before session)

Environment

info AppiumDoctor Appium Doctor v.1.11.1 info AppiumDoctor ### Diagnostic for necessary dependencies starting ### info AppiumDoctor ✔ The Node.js binary was found at: node_modules/.bin/node info AppiumDoctor ✔ Node version is 12.6.0 info AppiumDoctor ✔ Xcode is installed at: /Applications/Xcode.app/Contents/Developer info AppiumDoctor ✔ Xcode Command Line Tools are installed in: /Applications/Xcode.app/Contents/Developer info AppiumDoctor ✔ DevToolsSecurity is enabled. info AppiumDoctor ✔ The Authorization DB is set up properly. info AppiumDoctor ✔ Carthage was found at: node_modules/.bin/carthage. Installed version is: 1.0.6 info AppiumDoctor ✔ HOME is set to: /Users/vz8zw5 info AppiumDoctor ✔ ANDROID_HOME is set to: /Users/vz8zw5/Library/Android/sdk info AppiumDoctor ✔ JAVA_HOME is set to: /Library/Java/JavaVirtualMachines/jdk1.8.0_91.jdk/Contents/Home info AppiumDoctor ✔ adb exists at: /Users/vz8zw5/Library/Android/sdk/platform-tools/adb info AppiumDoctor ✔ android exists at: /Users/vz8zw5/Library/Android/sdk/tools/android info AppiumDoctor ✔ emulator exists at: /Users/vz8zw5/Library/Android/sdk/tools/emulator info AppiumDoctor ✔ Bin directory of $JAVA_HOME is set info AppiumDoctor ### Diagnostic for necessary dependencies completed, no fix needed. ### info AppiumDoctor info AppiumDoctor ### Diagnostic for optional dependencies starting ### WARN AppiumDoctor ✖ opencv4nodejs cannot be found. WARN AppiumDoctor ✖ ffmpeg cannot be found WARN AppiumDoctor ✖ mjpeg-consumer cannot be found. WARN AppiumDoctor ✖ idb and idb_companion are not installed WARN AppiumDoctor ✖ applesimutils cannot be found WARN AppiumDoctor ✖ idevicelocation cannot be found WARN AppiumDoctor ✖ ios-deploy cannot be found WARN AppiumDoctor ✖ ios_webkit_debug_proxy cannot be found WARN AppiumDoctor ✖ ifuse cannot be found WARN AppiumDoctor ✖ bundletool.jar cannot be found info AppiumDoctor ### Diagnostic for optional dependencies completed, 10 fixes possible. ### info AppiumDoctor info AppiumDoctor ### Optional Manual Fixes ### info AppiumDoctor The configuration can install optionally. Please do the following manually: WARN AppiumDoctor ➜ Why opencv4nodejs is needed and how to install it: https://github.com/appium/appium/blob/master/docs/en/writing-running-appium/image-comparison.md WARN AppiumDoctor ➜ ffmpeg is needed to record screen features. Please read https://www.ffmpeg.org/ to install it WARN AppiumDoctor ➜ mjpeg-consumer module is required to use MJPEG-over-HTTP features. Please install it with 'npm i -g mjpeg-consumer'. WARN AppiumDoctor ➜ Why idb is needed and how to install it: https://github.com/appium/appium-idb WARN AppiumDoctor ➜ Why applesimutils is needed and how to install it: http://appium.io/docs/en/drivers/ios-xcuitest/ WARN AppiumDoctor ➜ idevicelocation is used to set geolocation for real device. Please read https://github.com/JonGabilondoAngulo/idevicelocation to install it WARN AppiumDoctor ➜ ios-deploy is used to install iOS applications to real device. Please read http://appium.io/docs/en/drivers/ios-xcuitest-real-devices/ to install it WARN AppiumDoctor ➜ ios_webkit_debug_proxy is used to proxy requests from Appium to MobileSafari running on real device. Please read https://github.com/google/ios-webkit-debug-proxy to install it WARN AppiumDoctor ➜ ifuse is used to manage files/folders against a real device. Please read https://github.com/appium/appium/blob/master/docs/en/writing-running-appium/ios/ios-xctest-file-movement.md to install it WARN AppiumDoctor ➜ bundletool.jar is used to handle Android App Bundle. Please read http://appium.io/docs/en/writing-running-appium/android/android-appbundle/ to install it

Details

Code To Reproduce Issue [ Good To Have ]

@Test public void manin1 () throws MalformedURLException {

        DesiredCapabilities caps = new DesiredCapabilities();
        caps.setCapability("automationName", "XCUITest");
        caps.setCapability("noReset", "false");
        caps.setCapability("fullReset", "true");
        caps.setCapability("platformName", "iOS");
        caps.setCapability("platformVersion", "12.1");
        caps.setCapability("deviceName", "iPhone X");
        caps.setCapability(CapabilityType.BROWSER_NAME,"safari");

        URL url = new URL("http://127.0.0.1:4723/wd/hub");

        AppiumDriver<MobileElement> driver = new AppiumDriver<MobileElement> (url,caps);

        driver.manage().timeouts().implicitlyWait(Constants.DEVICE_WAIT, TimeUnit.SECONDS);
        driver.manage().timeouts().setScriptTimeout(Constants.SYNC_WAIT, TimeUnit.SECONDS);
        driver.manage().timeouts().pageLoadTimeout(Constants.WAIT, TimeUnit.SECONDS);
            driver.get("http://www.google.com");
                     driver.quit(); 
        }
crenshaw78 commented 4 years ago

I am having the same issue. Any luck on this yet?

reqwertypilot commented 4 years ago

Similar issue, simulator always starts in "External Display" mode

sfkir commented 4 years ago

The same issue after updating to Appium 17.