CodedUITest failing because of Taskbar thumbnail blocking the control - coded-ui-tests

My codedui test get failed, when some of the control blocked by the taskbar thumbnail.
I have turned off the taskbar thumbnail.
Is there any other solution that we can do it programmatically by resizing the window or something?
Please advise.

The ApplicationUnderTest class has a property called maximized you can set to true:
var application = ApplicationUnderTest.Launch(LAUNCH_LOCATION);
application.Maximized = true;
This will launch the application and then maximize it.

Related

FlxButtonPlus not responding to anything inside of game's pause menu

I am using the haxeflixel game framework to create a game and I was making a pause menu. I tried using the default FlxButton but the collision with the mouse never lined up properly. So I tried using FlxButtonPlus because it had some cool hooks but the button will not respond to any inputs. here is my code declaring the button in the pause menu
final unpausebut = new FlxButtonPlus((FlxG.width / 2) - 80,(FlxG.height / 2) - 10,unpause,"unpause",48,16); unpausebut.loadButtonGraphic(buttonNormal,buttonHovered); add(unpausebut);
Here is a picture of the pause menu itself so far.
but the button doesn't seem to respond to anything. I am also getting no errors inside of the terminal. unpause is a function inside of the code that also closes the substate. Can anybody help?

CUITe/Coded UI : mouse.Click position wrong (Screen resolutions)

I'm using CUITe to automate the testing of a UI piece (captured as a Page Object model).
I have a class that captures the buttons in my UI, like so:
class Navigators : CUITe_BrowserWindow
{
public new string sWindowTitle = "Window";
public CUITe_HtmlInputButton next = new CUITe_HtmlInputButton("Id=Content_btnNext");
// Other such buttons
//And a method to click any button
public void ClickButton(string id)
{
CUITe_BrowserWindow.GetBrowserWindow<Navigators>().Get<CUITe_HtmlInputButton>(string.Concat("Id=", id)).Click();
}
}
And the test I'm trying to automate is this, the click of a button:
CUITe_BrowserWindow.Launch<Navigators>("url");
CUITe_BrowserWindow.GetBrowserWindow<Navigators>().ClickButton("Content_btnNext");
My problem is this:
When I project my screen to a secondary monitor and extend it, the 'Next' button is clicked perfectly. However, on my system, the mouse passes over the button to another position and the click doesn't happen.
I have tried refreshing the CodedUI cache (by setting SearchConfiguration to Always), but that hasn't worked. Also, SetFocus on the control works correctly, whereas DrawHighlight shows the wrong position.
Any help would be greatly appreciated.
EDIT
When I changed my screen's resolution to 1440x900 (which is that of the secondary monitor's), the click happened.
I would be glad if someone could provide links that show how to handle screens of different resolutions in Coded UI
This is how I click controls on Win 8.1 store app which may or maynot be of help to you:
Mouse.Click(new Microsoft.VisualStudio.TestTools.UITest.Input.Point(uiControl.Left + (uiControl.Width / 2), uiControl.Top + (uiControl.Height / 2)));
Below is how I've been doing it in my CUITe scripts & it works fine at 1920x1080 on my larger monitor & at 1280x1024 on my laptop screen.
Given your OR definition above.
using Navigators.ObjectRepository; //guessing the name here
var pgNavigator = new Navigators();
//whatever else you do before clicking on next
Navigators.next.Click();

Getting pyqt application focus for popup menu to disappear when clicking away from it

Let me quickly explain the background to this. I'm developing a custom menu system inside a 3D application called Softimage XSI. It has a PyQt application object created already and ProcessEvents is being called a certain number of times every second so that PyQt applications can exist in a non-modal state within XSI.
To implement the menu, I've got a webpage embedded in a toolbar which is calling a plugin for XSI that I've written to show a PyQt menu. This all works fine (albeit, slightly contrived!).
The issue is that when I show the menu, it won't disappear when I click away from it. If I move the mouse over the menu, and then click away from it, it will disappear. It's only when it first pops up.
I've tried everything I can think of. Here's a list:
Using QtGui.qApp.installEventFilter(menu) to try and catch the mousepressed signal. It never gets triggered. I suspect the application itself isn't receiving the click.
Using menu.raise_() makes no difference
Neither does QtGui.qApp.setActiveWindow(menu)
Or menu.setFocus()
I've also tried:
event = QtGui.QMouseEvent(QtCore.QEvent.MouseMove, pos, QtCore.Qt.NoButton, QtCore.Qt.NoButton, QtCore.Qt.NoModifier)
QtGui.qApp.sendEvent(menu, event)
I had a go writing my own QEventLoop, but it just crashed XSI. I suspect trying to run a modal loop inside the other one probably isn't a legal thing to do. Either that, or I really don't know what I'm doing (equally probable)
The only thing I have partial success with is using grabMouse(). This is what makes the menu close if I click away from the menu (only after the mouse has passed over the menu once), but I have to call it a couple of times for it to "stick".
So this is my code at the moment:
class MyMenu (QtGui.QMenu):
def __init__(self, parent = None):
QtGui.QMenu.__init__(self, parent)
self.grabbed=2
def getMouse(self):
if self.grabbed>0:
self.grabMouse()
self.grabbed-=1
def paintEvent(self, event):
QtGui.QMenu.paintEvent(self, event)
self.getMouse()
def hideEvent(self, event):
self.releaseMouse()
def ShowMenu():
menu = MyMenu()
menu.addAction("A")
menu.addAction("B")
menu.addAction("C")
submenu = MyMenu()
submenu.addAction("D")
submenu.addAction("E")
submenu.addAction("F")
menu.addMenu(submenu)
menu.setTearOffEnabled(True)
menu.setStyleSheet("font: 8pt \"Sans Serif\";")
submenu.setStyleSheet("font: 8pt \"Sans Serif\";")
submenu.setTitle("Window")
submenu.setTearOffEnabled(True)
pos = QtGui.QCursor.pos()
pos.setX(105)
menu.popup(pos)
#Prevent garbage collection
QtGui.XSIMenu=menu
QtGui.XSISubMenu=submenu
#Desperate acts!
menu.raise_()
QtGui.qApp.setActiveWindow(menu)
menu.setFocus()
Any thoughts or random suggestions would be very gratefully received as this is driving me nuts! Don't be afraid to suggest modifications to stuff I've already tried, as I'm relatively new to PyQt and I may well have missed something.
Many thanks,
Andy
Just before calling popup with self.trayMenu.popup(QtGui.QCursor.pos()), call self.trayMenu.activateWindow(). Putting activateWindow before popup makes the left-click menu work the same as the right-click menu and it goes away when you click elsewhere. :)

How to capture events fired from popup IE window

I want to prevent popup IE window from IE shortcut keys.This actually I done with the help of
newwindow2 function
void CDHtmlDialogEx::OnNewWindow2(LPDISPATCH FAR* ppDisp, BOOL FAR* Cancel)
{
//*Cancel = FALSE;//allow
*Cancel = TRUE;
}
I want to differentiate using ppDisp to open the popup window for particular operation.
How can I do this?
EDIT
How to use this ppDisp variable?Give sample for this usage of ppDisp variable.
Regards,
Karthik
ppDisp is the automate interface of the webbrowser control on the new window, that is, if you did not cancell the creation of the new window as showing here and created a new window instead.
We will not get this variable to get the document interface.

How to change the function called when I click in the close button on php-gtk?

I load a single instance of a window on php-gtk, I have a button named "Cancel" that hide(); the window, so when the window is needed again I just show();.
But when I click on the close button instead of the cancel button the window is destroyed. Even when I redirect the event (I'm not sure if i'm doing it right) it calls the first(just hide() function) and then the destroy method.
Any idea?
PD: I wouldn't want to destroy and recreate the windows because of php's crappy garbage collector and to be able to maintain previous data without having to refill the whole window(after all is supposed to be a desktop app).
Following the advice here: delete-event.
I changed my code to return TRUE:
function on_multipleCancelButton_activate()
{
global $GladeMultiple;
$MultipleWindow = $GladeMultiple->get_widget('multipleWindow');
$MultipleWindow->hide();
return TRUE;
}
On the GTK designer I linked the delete-event to this function.

Resources