Why does Appium use platformName instead of platform - selenium

Selenium exposes a PLATFORM capability:
Appium's MobileCapabilityType extends Selenium's CapabilityType interface but instead of using the PLATFORM capability, it exposes PLATFORM_NAME:
Tried searching why this is the case but couldn't find any explanation. Does anyone here know the reason?

Well that's not used Nowadays PLATFORM_NAME was used till appium java-client 1.7. From 2.0 it's just used internally
From ReadME
AppiumDriver is now an abstract class, use IOSDriver and AndroidDriver
which both extend it. You no longer need to include the PLATFORM_NAME
desired capability since it's automatic for each class. Thanks to
#TikhomirovSergey for all their work
And for why, they were using Selenium's Platform in the first version 1.3 but then everything changed in the 1.4 where they decide to make their own capabilities with the future of Appium in their mind
This is to avoid the conflict of using MAC platform to test on iOS devices
Coz Selenium provided only ANDROID and MAC as platforms and though you want to test on ios devices which runs on iOS and you have to set MAC as platform [which will be odd right]
Now you can have Firefox as platformName as well
And Appium is a seperate entity from Selenium and they can't ask Selenium to add a Platform as IOS for them.So They created their own capability I guess.

Related

How can I test a Crosswalk application with BrowserStack?

At our company, we maintain a legacy Android application which uses Crosswalk to embed a web view. We would like to implement automated end-to-end tests for this app using Appium and ChromeDriver.
Unfortunately, the version of Chrome used by Crosswalk is modified in such a way that ChromeDriver cannot connect to it. This is a known issue, and the recommended workaround is to use a custom patched version of ChromeDriver instead.
This solution works for running tests locally. But BrowserStack doesn't seem to allow for supplying a custom build of ChromeDriver. I can choose from a set list of versions, but that won't help, as none of those versions have the Crosswalk patch.
Is there a way to make this work with BrowserStack?
I had used BrowserStack for my native app tests as well. Currently, they do not provide any custom capability to select the ChromeDriver version.

Appium - RemoteWebDriver vs AppiumDriver initiation

What is the difference between initiating appium driver by using this
driver = new RemoteWebDriver(new URL("http://127.0.0.1:4723/wd/hub"), capabilities);
and
driver = new AppiumDriver(url, desiredCapabilities);
in terms of pre-requisites for initiating and the automation that they can handle or any other difference?
I have got the answer in this post.
Also , I came across a post , have a look at this . Its an excellent post about the selenium/webdriver architecture and its history which may clear a lot of doubts for some one looking for knowledge in this area. Specially in understanding how webdriver works internally end to end, from language binding command to return of the element.
EDIT: copy pasting from link above
RemoteWebDriver: This driver class comes directly from the upstream Selenium project. This is a pretty generic driver where initializing the driver means making network requests to a Selenium hub to start a driver session. Since Appium operates on the client-server model, Appium uses this to initialize a driver session. However, directly using the RemoteWebDriver is not recommended since there are other drivers available that offer additional features or convenience functions.
AppiumDriver: This driver class inherits from the RemoteWebDriver class, but it adds in additional functions that are useful in the context of a mobile automation test through the Appium server.
AndroidDriver: This driver class inherits from AppiumDriver, but it adds in additional functions that are useful in the context of a mobile automation test on Android devices through Appium. Only use this driver class if you want to start a test on an Android device or Android emulator.
IOSDriver: This driver class inherits from AppiumDriver, but it adds in additional functions that are useful in the context of a mobile automation test on iOS devices through Appium. Only use this driver class if you want to start a test on an iOS device or iOS emulator.
As you can see, the drivers and their names tie in closely with what they do. When it comes to initializing a driver, only use the Android or IOS drivers.

Is it possible to check and set wx.html2 to use WebKit on Windows?

Is it possible to do a combination of a check and a engine-switch on Windows for wx.html2 in wxPython 2.9.4.0 (development version)?
What I want to achieve is; to let the wx.html2 library use WebKit on Windows if Safari, Chrome or Opera (WebKit/Blink) is installed.
Does anyone have any experience with this and maybe how to achieve it? I also wonder where wx.html2 looks for the engine on each OS and how it asks to render it.
I tried using wx.webkit. But there are so many issues like; lack of documentation and the implementation of the object seems to break on different operating systems.
How does wxPython know to use Webkit? It doesn't, it's parent library, wxWidgets does a compile-time check. It assumes Webkit is installed if it's built on Mac or Linux, and assumes IE is installed if it's on Windows.
If you really want WebKit/Blink, then perhaps consider CEFPython, an embedded Chrome. There's an example at that link of a (very simple) wxPython application.

Is Selenium platform specific?

Is Selenium paltform specific. If yes then how can I develop a cross-platform specific application with it by first identifying the platform and then call the platform-specific selenium routines.
The IDE is a firefox plugin, but you can develop tests in multiple languages, which run on and against multiple platforms (including multiple browsers). Not really sure what you're trying to accomplish, but hopefully that helps.
Selenium is platform independent. This is because you run a Selenium RC server (which is a java application and hence can be run on any platform). Then you send selenese commands to the server which controls the testing activity on the browser. To send the selenese commands you can use any language (such as Java, PHP, Ruby etc). Now this again does not limit you in any way to a certain OS.
If you are using the Firefox plugin IDE to run the test cases then of course the platforms supported would be limited to platforms supported by Firefox.
Hope that answers.
I may be misunderstanding your question, but:
With Selenium RC (or Grid, more specifically), you can specify what platform you want your test to run on. Each node registers with the hub under a particular platform, and each test's DesiredCapabilities can request a platform.
As the other answers have stated, Selenium itself is platform independent but you can run your tests on a by-platform by-browser basis. Either way, the tests (in theory) should look the same and use the same native Selenium commands.
I am not so familiar with Selenium, but it looks to me that it works almost everywhere where you can install Firefox 2+.
Platforms Supported by Selenium
I'm using Selenium for a project that runs under Windows and Ubuntu. The only platform specific code is for starting the environment where it executes (headless X server under Ubuntu) and starting the Selenium jar file. The rest is all platform independent. I don't know if this will also work as smoothly when you try to use different browsers (I'm using Firefox on both platforms).

Webkit browser & automation

Have anyone come across open source tools/framework for Webkit browser test automation?
There is (not tried) WebAii Automation Framework where the current Beta 2.0.0.1 has Safari 3 support added on windows (it's free but I don't think it's opensource).
If you want do it yourself:
On Apple you should be able to script it AppleScript or from
MAC OS X > 10.4: there is Automator
On Windows you might consider using P/Invoke and looking at the WinLauncher tool from WebKitTools
I haven't seen a framework to run the tests but if you're looking for input to test against there is Ian Hickson's adhoc and evil test suites in addition to the traditional acid tests.
Which WebKit? Selenium seems to have drivers for several WebKit-based browsers.
WebKit itself has a test suite, to be implemented by each platform, which the WebKit documentation calls DRT or DumpRenderTree (see also LayoutTestController).