Giter Club home page Giter Club logo

Comments (11)

KazuCocoa avatar KazuCocoa commented on September 3, 2024 1

Did you use it on simulators?
https://appium.io/docs/en/writing-running-appium/ios/ios-xctest-pasteboard/index.html#mobile-getpasteboard

Perhaps, you can get/set the value if WDA was foreground (I haven't checked it, but we expected this works on simulators mainly)
appium/appium#11610

from webdriveragent.

KazuCocoa avatar KazuCocoa commented on September 3, 2024 1

Got it. Then, please ask their support team. I guess they have their own rule.
await this.driver.activateApp( 'com.facebook.WebDriverAgentRunner'); syntax seems good, but the bundle id depends on their environment.

from webdriveragent.

electricbubble avatar electricbubble commented on September 3, 2024

I haven't tried it on the simulator.

You're right, when WDA is foreground, I can get the content.

Thank you very much for your reply 🥳

from webdriveragent.

George-BC avatar George-BC commented on September 3, 2024

Did you use it on simulators?
https://appium.io/docs/en/writing-running-appium/ios/ios-xctest-pasteboard/index.html#mobile-getpasteboard

Perhaps, you can get/set the value if WDA was foreground (I haven't checked it, but we expected this works on simulators mainly)
appium/appium#11610

Is this still accurate? I have tried both Activate App and Background App, clipboard still returns nothing.

from webdriveragent.

KazuCocoa avatar KazuCocoa commented on September 3, 2024

I think so.
I quickly checked on my env, 14.2 x iPhone SE 2nd Gen x Xcode 12.1 combination. It worked when WDA was foreground.

Afaik, if you enabled clipboard sync between other devices (Handoff feature), it could affect when you copy something on other devices.
https://apple.stackexchange.com/questions/253109/how-can-i-disable-universal-clipboard-on-macos-and-ios

from webdriveragent.

George-BC avatar George-BC commented on September 3, 2024

I think so.
I quickly checked on my env, 14.2 x iPhone SE 2nd Gen x Xcode 12.1 combination. It worked when WDA was foreground.

Afaik, if you enabled clipboard sync between other devices (Handoff feature), it could affect when you copy something on other devices.
https://apple.stackexchange.com/questions/253109/how-can-i-disable-universal-clipboard-on-macos-and-ios

Could you please share a code sample? I don't understand why something like this doesn't work:

async getClipboard() {
       try {
           const backgroundApp = this.driver.backgroundApp(10);
           while (backgroundApp) {
               const clipboard = await this.driver.getClipboard();
               console.log(clipboard);
               let buff = new Buffer(clipboard, 'base64');
               return buff.toString('ascii');
           }
       } catch (error) {
           assert.fail("Unable to get clipboard");
       }
   }

Switching to Settings doesn't work either. Clipboard will still be empty or undefined.

from webdriveragent.

KazuCocoa avatar KazuCocoa commented on September 3, 2024

You should bring WDA to your foreground. It looks like you brought your test app to the background, but you did not bring WDA to the foreground.

Instead of this.driver.backgroundApp(10);, you should do like below addressed in http://appium.io/docs/en/commands/device/clipboard/get-clipboard/#description

@driver.activate_app 'com.example.WebDriverAgentRunner'  # here should be your proper WDA bundle id
@driver.get_clipboard

from webdriveragent.

George-BC avatar George-BC commented on September 3, 2024

Oh, thanks! I'm using WebDriverIO, will investigate.

from webdriveragent.

George-BC avatar George-BC commented on September 3, 2024

Is this an Appium issue? None of these work, first line timeout, others just fail immediately:
await this.driver.activateApp(undefined, 'com.facebook.WebDriverAgentRunner');
await this.driver.activateApp(null, 'com.facebook.WebDriverAgentRunner');
await this.driver.activateApp( 'com.facebook.WebDriverAgentRunner');

Bundle ID appears correct based on start of Appium logs

[2020-11-16 13:59:49:293 - [debug] [WD Proxy] Got response with status 200: {
2020-11-16 13:59:49:293 - [debug] [WD Proxy]   "value" : {
2020-11-16 13:59:49:293 - [debug] [WD Proxy]     "message" : "WebDriverAgent is ready to accept commands",
2020-11-16 13:59:49:293 - [debug] [WD Proxy]     "state" : "success",
2020-11-16 13:59:49:293 - [debug] [WD Proxy]     "os" : {
2020-11-16 13:59:49:293 - [debug] [WD Proxy]       "name" : "iOS",
2020-11-16 13:59:49:293 - [debug] [WD Proxy]       "version" : "13.3",
2020-11-16 13:59:49:293 - [debug] [WD Proxy]       "sdkVersion" : "12.0"
2020-11-16 13:59:49:293 - [debug] [WD Proxy]     },
2020-11-16 13:59:49:293 - [debug] [WD Proxy]     "ios" : {
2020-11-16 13:59:49:293 - [debug] [WD Proxy]       "simulatorVersion" : "13.3",
2020-11-16 13:59:49:293 - [debug] [WD Proxy]       "ip" : "192.168.11.159"
2020-11-16 13:59:49:293 - [debug] [WD Proxy]     },
2020-11-16 13:59:49:293 - [debug] [WD Proxy]     "ready" : true,
2020-11-16 13:59:49:293 - [debug] [WD Proxy]     "build" : {
2020-11-16 13:59:49:294 - [debug] [WD Proxy]       "time" : "Oct 19 2020 15:53:00",
2020-11-16 13:59:49:294 - [debug] [WD Proxy]       "productBundleIdentifier" : "com.facebook.WebDriverAgentRunner"
2020-11-16 13:59:49:294 - [debug] [WD Proxy]     }
2020-11-16 13:59:49:294 - [debug] [WD Proxy]   },](url)

from webdriveragent.

KazuCocoa avatar KazuCocoa commented on September 3, 2024

The productBundleIdentifier depends on how you set the bundle id. It refers to updatedWDABundleId capability or the default bundle id (com.facebook.WebDriverAgentRunner). If you built/installed the WDA without updatedWDABundleId capability, then it might be the default value. Or if you use Xcode 11 or newer, probably it has .xctrunner suffix like com.facebook.WebDriverAgentRunner.xctrunner. Xcode 11+ do like this change automatically in some cases outside of Appium.

If you manually have changed the bundle id, you should set it as you did.

from webdriveragent.

George-BC avatar George-BC commented on September 3, 2024

This is on BrowserStack, I don't have to interact with WebDriverAgent, its set up automatically. I tried updatedWDABundle capability earlier also, setting a custom name and had same result as above.

from webdriveragent.

Related Issues (20)

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.