Code Monkey home page Code Monkey logo

hello-openfin-selenium-example's People

Contributors

chordmemory avatar mjosling avatar weiteho avatar wenjunche avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

hello-openfin-selenium-example's Issues

Webdriverio / mocha test never executes hangs after client.init()

Hi,

I am trying to setup a webdriverio framework with mocha to test an OpenFin application. I've followed the instructions to the T from what's on the read me but the it() test never gets executed and seems to hang after the webdriver.remote(driverOptions).init() has been invoked.

The OpenFin app in test does open, i.e. the RunOpenFin.bat is executed and application opens successfully, but the test scenario it() is not executed and times out.

Any help would be greatly appreciated.

Unable to connect to renderer error when using the app with Layouts Service

We initialized our test repo based on this example project. However, whenever we add layouts service to application manifest file, we're getting Unable to connect to renderer error when we call getTitle method on newly opened application. Do you know any workaround solution to get rid of this problem?

Here's the code piece that switches between windows by looking at their title:

const tabs = await global.browser.windowHandles();

for (const tab of tabs.value) {
  await global.browser.switchTab(tab);

  const title = await global.browser.getTitle(); // Fails on this line for 
                                                 //the newly opened app with layout service

  if (title.match(windowTitle)) {
    return tab;
  }
 }

Here's the error log:

Promise was rejected with the following reason: disconnected: unable to connect to renderer

  Error: Promise was rejected with the following reason: disconnected: unable to connect to renderer
at window("CDwindow-af6e79b9-6aba-4c5c-9e40-cc5ee0917910") - switchTab.js:28:21
at switchTab("CDwindow-af6e79b9-6aba-4c5c-9e40-cc5ee0917910") - index.js:237:23
at title() - getTitle.js:31:28

Playwright with openfin

Team - I have a requirement to launch an .exe file which is built on openfin and once launched, there is a menu item which will take to chrome browser home page as google.com

Please help me how to do the above with PLAYWRIGHT. I am unable to perform with 'executablePath' params under chromium.launch(options)

Not working on Mac or Linux

I tried to get this working following the steps in the README today. It worked fine on Windows but not on Mac (10.14) or Ubuntu desktop (16.04 LTS). I used the chromedriver packages included with this repo in both cases.

Output from chromedriver with verbose turned on:

$ chromedriver --port=9515 --verbose
Starting ChromeDriver 2.37.544337 (8c0344a12e552148c185f7d5117db1f28d6c9e85) on port 9515
Only local connections are allowed.
[1559841386.148][INFO]: COMMAND InitSession {
   "desiredCapabilities": {
      "browserName": "chrome",
      "chromeOptions": {
         "args": [ "--config=http://localhost:9090/app_sample.json" ],
         "binary": "/Users/Avi/Dev/workspace/hello-openfin-selenium-example/RunOpenFin.sh",
         "extensions": [  ]
      },
      "handlesAlerts": true,
      "javascriptEnabled": true,
      "locationContextEnabled": true,
      "loggingPrefs": {
         "browser": "ALL",
         "driver": "ALL"
      },
      "requestOrigins": {
         "name": "webdriverio",
         "url": "http://webdriver.io",
         "version": "4.14.4"
      },
      "rotatable": true
   }
}
[1559841386.150][INFO]: Populating Preferences file: {
   "alternate_error_pages": {
      "enabled": false
   },
   "autofill": {
      "enabled": false
   },
   "browser": {
      "check_default_browser": false
   },
   "distribution": {
      "import_bookmarks": false,
      "import_history": false,
      "import_search_engine": false,
      "make_chrome_default_for_user": false,
      "skip_first_run_ui": true
   },
   "dns_prefetching": {
      "enabled": false
   },
   "profile": {
      "content_settings": {
         "pattern_pairs": {
            "https://*,*": {
               "media-stream": {
                  "audio": "Default",
                  "video": "Default"
               }
            }
         }
      },
      "default_content_setting_values": {
         "geolocation": 1
      },
      "default_content_settings": {
         "geolocation": 1,
         "mouselock": 1,
         "notifications": 1,
         "popups": 1,
         "ppapi-broker": 1
      },
      "password_manager_enabled": false
   },
   "safebrowsing": {
      "enabled": false
   },
   "search": {
      "suggest_enabled": false
   },
   "translate": {
      "enabled": false
   }
}
[1559841386.150][INFO]: Populating Local State file: {
   "background_mode": {
      "enabled": false
   },
   "ssl": {
      "rev_checking": {
         "enabled": false
      }
   }
}
[1559841386.153][INFO]: Launching chrome: /Users/Avi/Dev/workspace/hello-openfin-selenium-example/RunOpenFin.sh --config=http://localhost:9090/app_sample.json --disable-background-networking --disable-client-side-phishing-detection --disable-default-apps --disable-hang-monitor --disable-popup-blocking --disable-prompt-on-repost --disable-sync --disable-web-resources --enable-automation --enable-logging --force-fieldtrials=SiteIsolationExtensions/Control --ignore-certificate-errors --load-extension=/var/folders/8m/b6b3fk0n5kj3ngbddjlnb1qw0000gn/T/.org.chromium.Chromium.z5eqBw/internal --log-level=0 --metrics-recording-only --no-first-run --password-store=basic --remote-debugging-port=12962 --test-type=webdriver --use-mock-keychain --user-data-dir=/var/folders/8m/b6b3fk0n5kj3ngbddjlnb1qw0000gn/T/.org.chromium.Chromium.nT0Ezy data:,
[1559841386.154][DEBUG]: DevTools request: http://localhost:12962/json/version
startup_url==http://localhost:9090/app_sample.json
devtools_port=12962
[1559841386.167][DEBUG]: DevTools request failed
[1559841386.217][DEBUG]: DevTools request: http://localhost:12962/json/version
[1559841386.218][DEBUG]: DevTools request failed
[1559841386.268][DEBUG]: DevTools request: http://localhost:12962/json/version

Output from npm run testWIO:

hello-openfin-selenium-example Avi$ npm run testWIO

> [email protected] testWIO /Users/Avi/Dev/workspace/hello-openfin-selenium-example
> mocha test/WebDriverIO/Mocha/hello-openfin.js



  Hello OpenFin App testing with webdriver.io
[12:16:25]  COMMAND	POST 	 "/session"
[12:16:25]  DATA		{"desiredCapabilities":{"javascriptEnabled":true,"locationContextEnabled":true,"handlesAlerts":true,"rotatable":true,"browserName":"chrome","chromeOptions":{"extensions":[],"binary":"/Users/Avi/Dev/workspace/hello-openfin-selenium-example/RunOpenFin.sh","args":["--config=http://localhost:9090/app_sample.json"]},"loggingPrefs":{"browser":"ALL","driver":"ALL"},"requestOrigins":{"url":"http://webdriver.io","version":"4.14.4","name":"webdriverio"}}}
    1) "before all" hook


  0 passing (20s)
  1 failing

  1) Hello OpenFin App testing with webdriver.io "before all" hook:
     Error: timeout of 20000ms exceeded. Ensure the done() callback is being called in this test.
  



npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] testWIO: `mocha test/WebDriverIO/Mocha/hello-openfin.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] testWIO script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/Avi/.npm/_logs/2019-06-06T17_16_45_131Z-debug.log

I can see openfin launches fine on both Mac and Ubuntu (the app pops up, so its reading the config file fine and launching) but it appears that the devtools port is not exposed correctly. Based on the output of RunOpenFin.sh in chromedriver it appears the remote debugging port is being passed from chromedriver to the openfin command but it's not working right. I tried to open http://localhost:<devtools_port> and that also did not work. I can reproduce the same if I simply launch openfin -l -c config -p port -- the remote debugging port is not accessible then either.

Can anyone reproduce this currently or have any idea how to get this working?

Openfin automation with selenium

I have one openfin application and I want to automate that application.
i m using below steps :
1- open chrome driver and open a chrome blank browser
2- launch the openfin application
3- use driver method to identify the objects in the application.

I want to know if I m doing anything wrong because I m not able to identify any objects

Do I need to change anything in the json file before running the 2nd step

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.