Running selenium test through physical device - selenium-webdriver

I work on test automation for a mobile version of a website. I have several tests that I generally run through ChromeDriver or Browserstack. However, what I would really like to do is hook up my phone and run my tests through the phone. I have tried appium but I am starting to realize that it is only used for apps and not mobile versions of websites.. Does anyone have any experience in running tests through a physical device? If so, what tools did you use or do you know of any good online tutorials?

Appium IS for testing websites on mobile devices.
You must pass the appium server the browserName parameter instead of the app parameter.
I suggest reading the appium documentation.
I have used Appium, Selenium Grid and testNG to run parallel tests for websites on real devices, so if you need any further guidance feel free to ask.
Hope this helps,
Liam.

Yes of course you van use Appium for mobile web application test. In fact you can use native browser or chrome browser in Android. And Safari browser in IOS.
If you want to start the web automation for Android i suggest you to follow the following tutorial with the example code.
appium-web-application-automation-in-android

I am writing this off the top of my head, not while I am doing it. This often leads to it not being 100% correct. There might have to be made some adjustments.
iPhone
This is what I have done:
Download and run Appium Server
Install xCode Tools
Run iPhone Simulator
Get your devices ID, in console, type
instruments -s devices
Set capabilities
WebDriverManager.setGlobalExtraCapability("platformName", "iOS");
WebDriverManager.setGlobalExtraCapability("platformVersion", "14.4");
WebDriverManager.setGlobalExtraCapability("deviceName", "iPhone 11");
WebDriverManager.setGlobalExtraCapability("appium:automationName", "xcuitest");
WebDriverManager.setGlobalExtraCapability("appium:udid", "your devices ID");
WebDriverManager.setGlobalExtraCapability("browserName", "Safari");
WebDriver driver = WebDriverManager.getWebDriver();
On the phone you have to set some mode, but I can not find anymore, which one that was. (Please write in comments if you know.)
Run Test
I hope I have not forgotten anything, as this was a process.

Related

Mobile Automation Test with Appium and Saucelabs

I'm a newbie on Appium and Saucelabs. If I understand correctly, the test script must be executed on my machine and the commands are sent in Saucelabs cloud, step by step (via http). If this assumption is correctly, can I executed script for iOS and Android on Windows machine? Mac OSX is required for iOS test?
Appium Studio is an IDE that lets you run iOS or Android on any machine. Mac OSX is not required fr iOS test with Appium. https://experitest.com/mobile-test-automation/appium-studio/datasheet/
Are you testing a native app or web app? I work for Testim that helps automate testing. We can emulate the devices from Chrome driver for web app testing. We recently came out with an easy free tool that enables you to record tests and then copy the code that can run on your Playwrite testing framework.
https://www.producthunt.com/posts/testim-s-playwright-recorder-playground
Check it out and let us know how you like it.

Robot Framework, why does it need more web drivers for other browsers?

Selenium is a web driver itself so why do I then need to download browser-specific drivers? Does Selenium only natively support Firefox and therefore need them to "translate" so that it understands or?
Sorry to be vague but I am genuinely confused by this.
Thanks in advance!
Selenium is not a webdriver. Selenium is the name of the project that encompasses webdriver and other software. The whole point of selenium/webdriver is that it doesn't know about any browsers. The point of the driver is to allow selenium to use an abstract interface, and then browser-specific modules can be installed to provide a concrete implementation of the interface for a specific browser. The design of selenium thus requires a driver for every browser that you want to automate.
That being said, selenium comes with a some drivers pre-installed, so you only have to install additional drivers if the browser(s) you are testing that are not part of the default set.
For more insight into why it's good to be able to download other drivers, see this blog post from one of the selenium contributors: Are you kidding me, IE Driver? Another freaking thing to download?
(thanks to #JimEvans for some comments that I've incorporated into this answer)

Where can I find mobile emulators to test my website with?

I want to use mobile emulator/simulators to test my website with. I only found Opera Mini (http://www.opera.com/mobile/demo/) and Windows Mobile 6 (http://www.microsoft.com/download/en/details.aspx?id=9263)
Where can I download emulators for more recent mobile devices?
P.S. Please let me know if this does not belong in StackOverflow, thanks.
I found MITE to be most helpful.
Even better, you get a lot of support for the free version, but (if you pay for Pro) you get almost every mobile browser out there, the ability to remotely test (load speed) and a lot of other cool features.

Mobile Phone emulator

Is there a good all in one emulator for testing mobile websites. Just using 'media queries and need to test on predominantly iphone, blackberry, android, and windows 7 phones.
Many thanks,
C
There is no one solution that will work on all these platforms however the SDKs for all include simulators/emulators and the best part is that all but for the iPhone are free.
BlackBerry Simulators
Android Emulator
Windows Phone 7 Emulator
The iPhone SDK also includes a simulator (Mac only) but if you need to test on a PC, you can do a pretty good job using http://iphone4simulator.com/ running in Safari for Windows.
As with all simulator/emulator usage, these are good for initial testing but you need to use an actual device to get true results.
Also note that different BlackBerry devices use different default browsers. Android devices also use varying versions of WebKit so you may see some variation between actual devices which isn't shown in the emulator.
In addition to Matt's reply, I think you should also test the different browsers available for smartphones.
For example the popular Opera mobile: http://www.opera.com/mobile/demo/
You might find http://quirktools.com/screenfly/ very useful for testing mobile websites on different screen sizes. It's not as true as a native emulator, but it allows you to test several phones, tablets, etc. at one site and you don't have to install any software.
try http://www.browserstack.com/. This one is not free, but it gives a trial period of 30 minutes for each account we create
Try Mobile web browser emulator this free tools help you testing mobile websites
If you just want to simulate the mobile device user agent and screen resolutions, also check out chrome's mobile device simulator https://developer.chrome.com/devtools/docs/device-mode#enable-device-mode

Automated UI testing of SilverLight on Mac

I'm looking to do automatic UI testing of SilverLight applications on Mac.
There are a few tools to test SilverLight on windows but I couldn't find any that will run tests on Mac.
Anybody know of such a tool?
Shahar
I was referred to this
http://www.hanselman.com/blog/UnitTestingSilverlightWithSelenium.aspx
Not the best solution but it is some a start
Microsoft's Test Manager is a very useful tool for PC.
http://msdn.microsoft.com/en-us/library/bb385901.aspx
But I'm not sure if its possible for Mac. So you can just test for browsers run on PC. Firefox is also available on Mac as far as I know. I don't think Safari browser behaves diffrent because silverlight is a plugin and most of your code work on this plugin.

Resources