Small window when I add Toolbar Break - pyqt5

I'm trying to add a second toolbar below the first. So I add added a toolbar break and it worked but now when I run the program the window is too small. What I do wrong?
I'm working in PyQt5 5.15.4
self.navtb = QToolBar("Navigation")
self.addToolBar(self.navtb)
self.addToolBarBreak()
self.fav = QToolBar("Bookmarks")
self.addToolBar(self.fav)
self.navtb.setMovable(False)
self.fav.setMovable(False)

Related

VBA selenium scroll windows to element point

In VBA I need to move in Selenium viewport to the element to be clickable. I tried code below ;
.Mouse.MoveTo(.FindElementByXPath("//*[#id=""main-content""]/section[2]/ul/li[2]/div/a"),13,13) 'error Expeted = sign
.Actions.MoveToElement (.FindElementByXPath("//*[#id=""main-content""]/section[2]/ul/li[2]/div/a")) 'ineffective screen does not scroll down. Note: Windos is set to Maximize
the code is added but does not work, I could not add to the comment section
.FindElementByXPath("//*[#id=""main-content""]/section[2]/ul/li[2]/div/a").Click
.Actions.MoveToElement(.FindElementByXPath("//*[#id=""main-content""]/section[2]/ul/li[2]/div/a")).Perform
.Actions.MoveToElement(.FindElementByXPath("//*[#id=""main-content""]/section[2]/ul/li[2]/div/a")).Perform
.Actions.MoveByOffset(300, 300).Perform
.FindElementByXPath("//*[#id=""main-content""]/section[2]/ul/li[2]/div/a").Click
To move Selenium's focus to the element you can use either of the following lines of code:
.Actions.MoveToElement(.FindElementByXPath("//*[#id=""main-content""]/section[2]/ul/li[2]/div/a")).Perform
or
.Actions.MoveToElement(.FindElementByXPath("//*[#id=""main-content""]/section[2]/ul/li[2]/div/a"), 13, 13).Perform

ToolStripTextBox image is not appearing

I am using WindowsForms and I am trying to put a Textbox into my main menu and add an Image. However I cannot get the image to appear. What am I missing here.
txtRequestEdit.DisplayStyle = ToolStripItemDisplayStyle.ImageAndText
txtRequestEdit.Image = Properties.Resources.Wrench16 'This is a valid image.
txtRequestEdit is a System.Windows.Forms.ToolStripTextBox
EDIT- Here is an image of the menu. The item at the bottom of this menu is the txtRequestEdit control.
Strangely the no matter how you apply the image, it won't show on ToolStripTextBox. I think this is a bug because I found nothing about this behavior in the documents or on the web.
I will try doing this with a hack like owner-drawing the item or something else and will put the wrong answer here so the next person with this issue avoids this wrong path.
This is wrong:
Apparently the Image property "supports the .NET Framework infrastructure and is not intended to be used directly from your code.", so if (as you say) everything's OK and you've checked the image itself to be valid, using ImageList and ImageIndex may solve the problem (assuming the item lies inside a MenuStrip named menuStrip1:
txtRequestEdit.DisplayStyle = ToolStripItemDisplayStyle.ImageAndText
menuStrip1.ImageList = New ImageList()
menuStrip1.ImageList.Images.Add(Properties.Resources.Wrench16)
txtRequestEdit.ImageIndex = 0

Window object recognition using RFT on Print Dialogue

Why is RFT not recognizing the objects I have on a windows Print dialog.Included are few screen shots.
I am able to get the correct activeWIndow by
TestObject[] to ;
IWindow activeWindow = RationalTestScript.getScreen().getActiveWindow();
System.out.println("Class of active window is "+activeWindow.getCLass()): // returns #32770
ScreenTestObject root = RootTestObject.getScreenTestObject();
to = root.find(atLIst(atDescendant(".class", false),atChild(".class", ".Pushbutton", ".text", "Print"))) ;
Apparantly I can't post pictures. here is the link for print window and print button properties screenshot
http://www.flickr.com/photos/24358027#N07/12977082214/in/set-72157641973533994
...resolutions is horrible, I can type all the information if anyone needs it. Sorry and Thanks in advance.
Try The below Code snippet. I tried launching the print dialog from notepad and ran below script to find the print button and click it.Hope it helps.
//Find the Print button
TestObject[] to = find(atDescendant(".class",".Pushbutton",".text","Print"),true);
System.out.println(to.length);
//If you are sure you have just one print button on screen.
if(to.length==1)
((GuiTestObject) to[0]).click();
//Else traverse through the found object and compare the properties of the button you want to click
Update : I did a workaround for this, using tab to navigate. Once Tab is on the button, I input Enter. So it's not a work stoppage issue anymore, but I do need to figure out the right way to do it.
Thanks

Autohotkey to resize window with child windows

I use FrontPage 2003 for linking html files, through the command 'Insert' > Hyperlink.
And the window opens as follows:
I made a script with Autohotkey to resize the window, so I see more of the files in the 'current folder' (I think the class is SysTreeView32), but it doesn't apply to the child windows (I guess it is called mdichild), it shows as follows:
What I need is to make the script resizes the window and all the child windows.
The current scrip is:
#NoEnv
ResizeWin(Width = 0,Height = 0)
{
WinGetPos,X,Y,W,H,A
If %Width% = 0
Width := W
If %Height% = 0
Height := H
WinMove,A,,%X%,%Y%,%Width%,%Height%
}
#!u::ResizeWin(800,800)
From the screenshot, it looks like the resize is working.
Unfortunately, there are some windows that just don't resize properly. I assume that if you use your mouse, you can't resize it manually either. This is especially prevalent for older programs.
The only way of resizing individual controls, would be to use the ControlMove command.
However, in order to use this command, the control must be able to be detected. This would be either as ClassNN, control name, or HWND (window handle).

How would I triple-click in Sikuli?

I am trying to select an entire line of text on a web page (in a table) using Sikuli. The easiest way to select the text is to "triple-click" on it. Is there a way to triple-click in Sikuli?
Thanks!
GregH,
I got the following to work for me:
click(img.png)
mouseDown(Button.LEFT)
mouseUp(Button.LEFT)
wait(0.01)
mouseDown(Button.LEFT)
mouseUp(Button.LEFT)
This allowed me triple click on a button, link, or whatever I needed to click on.
This works for me:
def tripleClick(PSMRL):
hover(PSMRL)
for x in xrange(3):
mouseDown(Button.LEFT)
mouseUp()
quick fix solution would be to check out the mouse settings in control panel and you can lower the time between clicks required to register successive clicks needed to perform the 'triple click' action
Have you tried low level mouse functions? Something like this should work:
for x in xrange(3):
region.mouseDown()
region.mouseUp()
Depending on what is being clicked, sometimes, the click type is the same as multiple clicks in succession. Meaning, if what needs to be clicked doesn't have to be double/triple-clicked very fast, then you can just use a sequence of single clicks. 2 clicks = double-click, 3 clicks = triple click. I know that 2 clicks will simulate a double-click on Windows desktop (not sure about things like games, etc.)
I've seldom heard of a triple-click action though.
So, have you tried using 3 clicks to simulate triple-click to see if that works or not?
I f you use .click() will be good enough.
.click() is the left mouse button, .rightClick() is the right mouse button.
For example:
image1 = ("image1.png")
def multiClick(nTime):
imageLoc = find(image1)
for n in xrange(nTime):
imageLoc.click()
# Click 3 times.
multiClick(3)