1

I tried asking this on StackOverflow but unfortunately I couldn't find a solution to this there. Then I learned about SQA StackExchange so I thought I'd try here too.

I'm trying to write some test scripts which involves uploading a file via Chrome. I'm using Selenium's RemoteWebDriver in order to test the web application using Chrome on a Samsung Note 10 device.

I've managed to write the script up to the point of clicking on the file upload button which in turn bring up the file upload control asking me which type of file I'd like to upload. However since this is not a web control I can't interact with it using RemoteWebDriver. I tried to create a new instance of AppiumDriver but since an instance of RemoteWebDriver already exists I'm unable to create a new instance of AppiumDriver.

Is there anyway I could go about this issue? I tried to cast RemoteWebDriver as a AppiumDriver (despite feeling that it wouldn't work) but it wasn't possible.

  • Have you tried just using the Appium driver? It's pretty much the same thing as RemoteWebDriver and you should be able to automate Chrome with it. – thebeekeeper Dec 9 '14 at 19:43
  • AppiumDriver can't interact with HTML web controls can it? – Rusty Wizard Dec 10 '14 at 5:43
  • I'm currently using it to automate a hybrid app (native app with a web view control), so I think it ought to work. I'm not sure what kind of desired capabilities you'd have to send for it. – thebeekeeper Dec 10 '14 at 14:08
  • @thebeekeeper Using the Appium Driver works with HTML controls too. Thanks! If you could mention that in your reply below I could mark it as the correct answer. – Rusty Wizard Dec 15 '14 at 9:23
1

Ok, I found documentation for Appium that shows how to automate Chrome. Here is the link to the documentation. And here are the desired capabilities to send when you're starting the session:

DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability(MobileCapabilityType.PLATFORM_NAME, "Android");
capabilities.setCapability(MobileCapabilityType.PLATFORM_VERSION, "4.4");
capabilities.setCapability(MobileCapabilityType.DEVICE_NAME, "Android Emulator");
capabilities.setCapability(MobileCapabilityType.BROWSER_NAME, "Chrome");

Once you set up your session like this you can use Appium with regular HTML controls in a Chrome session.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.