I have a requirement where I want to switch between multiple drivers to execute tests. For e.g. Launch android app, perform some steps and do the validation in desktop browser. Once done, switch back to android app and continue with rest of the flow. There can be multiple instances, where I have to switch between multiple drivers
Use setDriver method of QAFTestBase to swich between drivers.
QAFTestBase testBase = getTestBase(); //TestBaseProvider.instance().get()
//switch to another driver
testBase.setDriver("firefoxDriver");
//do the needfull
testBase.setDriver("appiumDriver");
//switch back to mobile driver
Refer answer for similar question and notes from QAF.
Using QMetry Automation Studio, a user can execute the same feature file on different platforms like Web, MobileWeb, Android using CI/CD. The following blogs have detailed step to set up your QAS project to achieve it:
Executing test case by switching multiple drivers.
Executing a test case in multiple browsers in a parallel session.
Executing test case on multiple mobile platforms.
Related
In using .net selenium webdrivers, I have been stumbling in 2 main issues, each for a different specific webdriver.
The table below shows the issues Chrome and Firefox webdrivers have been falling short with me:
I am using RellYa's selenium jquery extensions.
Chrome webdriver randomly throws a jQuery not found exception. If I try a couple of times, I eventually succeed.
With Firefox's webdriver, this never happened.
On the other hand, firefox throws a
Unable to bind to locking port 7054 within 45000 ms
Research shows that the reason behind this is that I must have left another firefox webdriver not closed/not quit. But this defeats my using selenium to automate web tasks, in a multi threaded manner. I mean, after a couple of threads are opened, seems it reaches some limit and waits for one of the opened webdrivers to close.
Actually, from this firefox webdriver's documentation, they make it clear that only one instance is supposed to be running. What one is supposed to do then if he had in mind multi threading ?
Does any one have working solutions for the problems singled out in the table, for each specific webdriver implementations ?
No, you can run multiple instances of firefox, chrome, or whatever from your machine at any one time. If you research "Selenium Grid", you will see that it is designed to do that.
So:
The unable to bind message on firefox is not caused by another driver locking a port. Each driver instance starts on its own open port.
If you are not using Selenium Grid, or not using the grid, and are trying to handle the multi-threading yourself, just be careful of how you open and close your browsers in your #Configuration phases in your test runner.
As a educated guess, if you have instability, its more likely because you are trying to control a newer browser with a too-old version of Selenium? We need more info on your question, such as an example project to look at.
I am developing an application for the Firefox OS which is going to kill the applications which uses a lot of power of the mobile phone, I could find out the information about battery by using Battery API. So my question is
How to extract information about the processes which are running on the Firefox-OS?
Applications in Firefox OS are just iframes, so you can get the list of running processes by switching to the right window context and doing
var apps = document.getElementsByTagName('iframe');
apps.forEach(function(app) {
console.log(app.src); // Print out the app origin.
});
That being said, only apps with elevated privileges are allowed to execute code in the context you need. You can read more about certified apps here https://developer.mozilla.org/en-US/Marketplace/Publishing/Packaged_apps, but the short story is that certified apps are not distributed through the normal marketplace.
Hope that helps!
I have written my RF testcases using reusable keywords (built using native selenium webdriver not using Selenium2Library) and It works fine on single instance for what so ever browser I run.
But, I would like to execute these testcases in parallel on
1) Same machine different browsers
2) Different machine all browsers
Does Selenium Grid have native support to Robot Framework test cases? Or have any body found an alternative?
Yes, Robot Framework has native support for Java and Selenium2 within your defined "keyword" code blocks. All you do is use RemoteWebDriver in your keyword phrases instead of using WebDriver . This requires you run a Hub and a Node for the RemoteWebDriver to refer to, of course, or you can use a Sauce Labs account. Using Grid and Node you can run parallel tests with very little effort.
If you don't want to use RemoteWebDriver, you can still use WebDriver locally but you need to run parallel tests using "Maven surefire with threads" or a Gradle task with --parallel-threads=3" option. I have examples of this that you can see in my GitHub account.
I want to check the app is running on Tablet or PC using C# code in Windows 8 Metro Style apps
The short answer is: It can't be done.
You can have a tablet that doesn't run with a ARM processor, then it's basically a laptop, just in another form factor. The form factor is not something you check for using code. However you can still find the architecture and determine if you run ARM/x86/x64 checking out this blogpost - and then writing:
var cpu = await SystemInfoEstimate.GetProcessorArchitectureAsync();
You can also, in your project, set the CPU configuration - create separate ARM/x86/x64 configurations. And thereby create conditional builds of your application fitting each architecture.
I need to provide a way of users uploading multiple files (can be 10MB each) over Mac, PC and a mobile device (something with an SD slot).
The connection from the mobile device can be poor so I need to enable queuing of the files so they can be delivered when connection becomes available.
I am looking at Silverlight as a potential option using something like this example uses and sending over the files when a connection is available.
http://www.microsoft.com/silverlight/out-of-browser/demo/
I have tried searching for silverlight articles but not found anything appropriate. What I am trying to avoid is writing multiple versions of the software for Mac+PC (browser) and mobile device.
Can silverlight provide this kind of functionality or is something I would have to approach differently?
Silverlight can be used to do that.
You don't need to use the out-of-browser functionality, silverlight gives you low-level control over sockets and threads.
For devices it's a different scenario, as AnthonyWJones points out.
There is a silverlight version for the nokia, but I've know idea if it is actively developed. The is also a c++ version for linux/meego, there is a mono version.
But all those are different versions.