What would be an appropriate way to allow a user to script interactions with my pyqt5 application? - pyqt5

I currently have a pyqt5 application I've made to do antenna measurements. I'd like to be able to either
embed a python console in the application that the user can use to automate certain things in the application
or
provide an external API a user can interact with to manipulate the
I've been able to get qtconsole RichJupyterWidgets to work fine in my application, but it's siloed, obviously.
Do I need to figure out a way to do IPC for something like this?
Edit: The reason something like this would be useful is these measurements can take a while and often when measuring you need to change the configuration of your antenna (e.g. changing phase shifter values). Being able to change these configurations, take a measurement, save the data, change the configurations, etc, would be extremely beneficial!

Related

Synchronise user input during cross-browser testing

Are there any tools available that allow user input to be synchronised between browsers during manual cross browser testing?
For example, mouse clicks, data entry into a form etc.
Information:
This sort of functionality was described by Mads Kristensen in a recent DotNetRocks podcast. He outlined a BrowserLink extension he had created (around 11:00) that demonstrated this during a recent talk. However I'm unable to find any other reference to it, and would like to know if any other alternatives exist.
Could you explain how you mean 'synchronise'? As in, it needs to happen on each browser at exactly the same time? Or you just want a consistent set of data used and the timing to be the same for each test?
If the latter, I'd suggest looking at something like Selenium WebDriver. I know this is more automated, but you can't get something exactly consistent if you're doing it manually.

How to simulate 20 users click a button at the same time in Web GUI Test Automation

Now I hava a requirement about Web GUI TA
I want to simulate some users(20-30) click a button at the same time and evaluate the performance of Web GUI at that time.
I use RobotFrameWork + Selenium library to do the Web Gui TA before, but as far as I know. selenium library only can handle one broswer at one time, so i dont know how to do now.
Can you give me some advice? need use another library or framework?
Like mentioned by other, what you want to do in this case is not UI testing but rather stress/load testing. You should be able to try easily Gatling. First you record the http request associated with the click on your button. Then, you write a simple scenario that launches this request 20 times at once. Something like:
setUp(scn.inject(atOnce(20 users)))
.protocols(httpConf)
Selenium has a "grid" option you can use to configure many instances running many browsers.
http://www.seleniumhq.org/projects/grid/
http://www.seleniumhq.org/docs/07_selenium_grid.jsp
Grid allows you to :
scale by distributing tests on several machines ( parallel execution )
manage multiple environments from a central point, making it easy to
run the tests against a vast combination of browsers / OS. minimize
the maintenance time for the grid by allowing you to implement custom
hooks to leverage virtual infrastructure for instance.
In short, you create a "hub" that manages things, then each "node" can perform tests as required by the hub.
Consider, however, this may not be the best route to go down. Something like multi-mechanize might be more useful: http://testutils.org/multi-mechanize/
That will allow you to have many users "clicking" the button, but not via a browser but via direct HTTP calls. That might be more suitable for multi user simultaneous "headless" load testing, which is what I think you are attempting to do.
I'm slightly confused at this question:
Are you wanting to test the GUI? If it's something like "This button makes a dropdown menu appear", then it doesn't matter how many users do it at the same time, it'll either always work, or never work.
Are you wanting to test the server under load? If so, then Selenium will work, but there are better tools. I have used JMeter with success, but there is a really good listing of all of them here: http://performance-testing.org/
Finally, are you wanting to press 20 different buttons on the same page on the same browser at the same time? If so, this isn't possible with selenium, and it isn't a standard use case either.

Mac Post Events to specific background windows

I am trying to create an accessibility app that will type in multiple windows at once, neither of which are owned by my app. For instance, let's say you have two Microsoft word documents open. When you hit a keystroke I want the command to go to both windows.
I have tried using Quartz events services, but it looks like it will only allow you to post to events either on a global or process level. But if two windows are running for the same process, how do I post to a specific window?
There's also the issue of the person typing in one window, while the content is being copied to the next.
Is it possible to post to a single window?
PS I know it's possible to do this in Windows
MacOS X includes a few tools which may be helpful. You should look into the Accessibility framework, Automator actions, and AppleScript. You should also be aware of application-specific solutions; in the case of Word, for example, you might look at VBA (Visual Basic for Applications). All of these tools provide ways that you can modify the content of other applications. Unfortunately, the level of support for each one varies from one application to another, and the way they're used also varies. So, it's unlikely that you'll find a single solution that works for all applications.
It's unlikely that you'll find a way to insert events directly into another process's event queue. That'd be a huge security hole, for one thing. Even if you could do that, you really wouldn't be able to target specific windows with your events. Mac applications use a responder chain that sends keystrokes to the "first responder", usually a component of the active window.

Perform a task every day even if running only in background

I need my application to perform a background task every day, but it does not comply with Apple's specification for running in background.
It's none of these: audio, location, VOIP, news stand, external-accessory—, Bluetooth-central.
I'm planning to use local notifications, but the point is, that if the user doesn't open the app (and just leaves it in the background), I cannot plan new local notifications.
What should I do in this situation?
Make something else.
Seriously, if your app doesn’t at least technically fit one of those categories, you’re not going to be able to get it to do background work in a way that’ll get you approved for the App Store.
I’ve seen apps that added specific functionality in one of those categories, orthogonal to their actual purpose, to be allowed to run in the background; for instance, there’s a couple of weather apps out there that play a continuous audio file—one of the available sounds being a silent one—in order to be able to update the lock screen’s “now playing” image with live data. If you don’t mind your users being unable to listen to any other music, and have your app continuously active (which might cause additional battery drain), that could work. But if you’re trying to have your app invisibly do things in the background, without interfering with anything else, in a way that’ll get you into the App Store, you’re probably out of luck.
Four options:
Go for jailbreak
Try to get in the app store as one of those types of apps, making up a feature that uses one of those types.
(my favorite) Really rethink your system, is it really necessary to schedule background tasks? Can't the user wait a bit when he opens the app? That loading can be performed in background. And can't you offload some of the work to a webserver? Are you collecting data? You shoudln't without the user consent.
Let your user know that it's important for him (he's the one using it right?) that he opens the app once a day.
I think I covered all yohr options except the one already covered by Noah.

GPS code for server

Is there any code for GPS receiver and for GPS net server available?
I want to build complete application: a client for the MS Win Pocket PDA and a server which shows position of my trucks on map. It is easy to find via internet code for GPS receiver (PDA) but I cannot find corresponding part code for server.
If I am understanding you correctly, you want the code to be able to render trucks on a map on your server.
If that is the case, I think that the approach you need depends on the language you are using. Plotting GPS coordinates on an X-Y plane is not a straight forward thing to do, reason being that if you where to cut the surface of the globe into pieces you would not end up with perfect squares, and would thus have to use a technique called Map Projections.
There are various readily available mechanisms provided by companies such a Google provided that you implement a web application. If on the other hand you where looking for a desktop application, SwingX provides a Java API which allows you to build GPS related desktop applications through the use of OpenStreetMaps.
So basically, you can have something as follows:
Create a concurrent server which accepts data from these PDA's and save it in the DB;
At a given period of time, pull the data from your database and refresh your desktop application or web page.
Edit: You can take a look at this tutorial to see how you can draw and plot on a map Using SwingX. If you shall be using Java, you might want to give a look at this previous SO post for more Java mapping API's.