Protractor / webdriver seems to be bringing the window to foreground every time you take a screenshot programmatically from a test spec:
browser.takeScreenshot().then(function (png) {
// code that stores screenshot to hard-drive
});
Is there any way how to control this behaviour? I would ideally like to keep it in the background when running tests.
There is no workaround selenium side.
The option is a headless solution so e2e doesn't interrupt you while running the tests, see this answer: https://stackoverflow.com/a/23461432/511069
I use ubuntu-headless solution for this, you can still see the browser through a VNC connection but focus doesn't affect you ever.
Related
I am new to TOSCA (just trying to learn by self-studying - have a trial license).
I was trying to build a simple test case to open and close an application. In it I have used the TBox Window Operation Module to close the Browser but when I run it in scratchbox, I don't get any output. It just opens the browser to the demo app and exits without giving a success or an error message. I want to know why it isn't closing the browser window and giving me a success message.
Here is a screenshot:
Any help on this is appreciated.
Your testcase looks alright to me. I just tried myself and this should work.
After you've run the test you can always open up the scratchbook again, by clicking the 'scratchbook' button in the ribbon on the 'home' tab in the 'go to' group:
You should then see the details of your last run. A very common thing that happens to me is that Tosca cannot uniquely identify the window (e.g. because I have two windows with the same title open). The error would look like this:
So I'd check if opened the demo webshop more than once.
What is also good to know is, that Tosca will use your standard browser in the 'OpenUrl' module if you have not specified it otherwise, and the 'Window Operation Module' is agnostic to that. You can explicitly specify which browser to use in the 'OpenUrl' module by providing a TestConfiguration Parameter like this:
Hope that helps.
just use CloseBrowser module which can be found under Standard Modules.
Standard Modules are the set of modules which are shipped by default along with the installation of any Tosca instance.
You can use "close browser" standard module instead of window operation module to close the browser window.
I am new to TOSCA, kindly guide me How to Launching multiple browsers in TOSCA?
Thanks in advance.
Sreeni
Additionally to what Kapil said above (which was about using browsers), here is how you can actually "launch" (=start) browsers.
Tosca treats browsers like any other application - you can start a browser using the TBox Start Program module (that you can get access to by importing the standard subset).
Tosca's manual actually provides an example of how to start Internet Explorer using that module, it works in a similar fashion with the other browsers. Here is a screenshot:
For the sake of completeness, here's the link to the manual for more details: https://support.tricentis.com/community/manuals_detail.do?lang=en&version=10.0.0&url=ep_tbox/process_operations/process_operations.htm
We cannot trigger multiple browsers in TOSCA, but it supports cross browser execution. For cross browser execution:
1. Create a Test Configuration Parameter "Browser" either at TestCase or at its parent levels.
2. We can choose value InternetExplorer, Firefox, or Chrome.
3. The execution will be triggered on respective browser.
In order to achieve parallel execution we have to go with Distributed Execution (DEX).
On a project I work on, using Python3 + PySide, I try to print a popup-message as some sort of notification.
This popup needs to be on top of everything, this includes fullscreen applications like games or browsers. And that's the point that does not work. It works fine for all windows on my Desktop, normal windows, maximized, but as soon as there is a fullscreen application or a borderless window ("pseudo fullscreen") the popup is created, but "behind" the fullscreen app.
I already use self.setWindowFlags(QtCore.Qt.FramelessWindowHint | QtCore.Qt.WindowStaysOnTopHint) but this flag does get ignored by other fullscreen apps.
How do I fix this? Also without giving focus to the popup.
It is just there to present information, and it is not good when your window looses focus while playing a game.
My code can be found here: https://github.com/GosuSan/PyECM
additional Info:
- my project aims to be cross-platform, so I need a platform-independend solution
- I am running linux, without having a windows machine atm,
so I can't test stuff there.
If you need any more info, let me know!
Edit:
It seems that PySide.QtGui.QSystemTrayIcon.showMessage does what I want, it works on fullscreen as well as on borderless-windows. So I will try to either find out how those messages are displayed on top, or just use them, not sure for now.
I don't know whether I am right or wrong but just want to know can I run selenium webdriver scripts in background. I want to give some more explanation about this as
I have one script which will launch a browser (IE or FF) enter some data in some edit fields and click on some buttons.
Is it possible in background. If not can you please suggest me any tool.
You can try exploring htmlunitdriver
Is it OK to use threading.sleep in an intranet web application to display AJAX loading (in production environment)? Off course, the application works fine without it but all works too quick for the end user or even a developer to notice any difference.
What is the recommended approach ?
Just read this thread: I am amazed: you want an application to fetch data slower? That sounds really strange to me.
You should try to make it clear to the user that the new data is loaded. You can use an animation or something like a highlight color for new items. Maybe a 'new' icon?
Imagine that the servers are running slow deu to some errors. Than the user still has to wait an extra second to see the data. Just something to think about.