How would I triple-click in Sikuli? - scripting

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)

Related

Unable to break from the if condition and cannot click on element

I have a svg file and i need to click on the seats, So i have used driver.findelements() when a seat is clickable it should click on it and come out of the if condition. But when i use break it is not clicking the seat, When i do not use break it will go into infinite loop.
How do i break after the seat is selected.
Please find the attached code
Make recursive function which keeps on checking that element is enabled or not.
once it is enabled , it will click and come out.
def click_enabled_element(enable_value = False)
if enable_value:
i.click()
return
else:
click_enable_element(i.isEnabled())

Tosca: How to scan Dropdown textbox which disapper upon opening xScan

I have a problem in scanning a drop-down menu which disappears upon opening the xScan. I need to get the module id of the dropdown menu to verify some test steps.
Do you have any solution with this if it is not really possible to get the module id of the dropdown menu?
Open developer tools in your browser of choice (F12), navigate to the console and input the following code:
var fulldoc='';
var scrollX=0;
var scrollY=0;
document.addEventListener("keydown",function(event){
if(event.key=='q' && event.altKey){
fulldoc=document.body.outerHTML;
scrollY=window.pageYOffset;
scrollX=window.pageXOffset;
}
if(event.key=='w' && event.altKey){
document.body.outerHTML=fulldoc;
document.body.scrollTo(scrollX,scrollY);
}
});
When the window looks the way you would want to scan, press 'Alt + Q', then press 'Alt + W'.
Now your window will freeze and then you can scan your page.
To steer the objects you need to refresh your browser.
You can resolve the issue with below 2 steps
1 - Add some text in textbox which will populate the dropdown below it .
2 - Use Send Keys Module to scroll down and select the value.
I had a similar issue where we had a popup that only appeared when clicking on a text box. The solution we received from the Tricentis trainer was as follows:
Part One
1. Open your application in Chrome
2. Right click the inspect
3. In the inspector window, on the Elements tab, navigate to your html element where it should be (you can do that by clicking on the element and check that you can see the html in the element)
4. Use the debugger to add a break point there, this should pause it and you should be able to see the elements you need to steer it.
5. Once you found the element, you will need the type of element (e.g. div, span, etc), and the class name
Part two
1. Rescan your module and select any element that matches the criteria of your element selected in Part One #5
2. Identify it by only it's class name property and tag
3. Save and close
4. Edit the element in the module view by changing the class name. This should help you steer it
Note: if the element class name is not unique, you might need to use Explicit name.
Good luck

Blender 2.78a (When im trying to move my object and enter a value it doesn't work)

I'm having problem with my work in blender, im using the latest version of the blende 2.78a.
But when i try to move my object and hit the x key then enter a value (2.50) it doesn't work.
Any help please =)
Did you first selected the object with right mousbutton and pressed the G key for moving the object?
If it still not works I have some other suggestions for you:
select the model, go to the panel on the right, press the "Object data" button (with the orange Cube on it) and then enter the numbers at "Location"
make sure you enter the numbers with a . not a , !!! (i also made this mistake)
press N to open an new propertiespanel on the right of the 3d-view and
look at the "Location"s; are the locks behind the coordinates blocked?
if so just click to unlock the positions

Rename wxTreeCtrl item

I want the normal rename on double click and/or F2
So:
new wxTreeCtrl(this,IDC_Tree,wxPoint(-1,-1),wxSize(-1,-1),
wxTR_HAS_BUTTONS | wxTR_LINES_AT_ROOT | wxTR_EDIT_LABELS);
Double click does not rename. ( it displays the children of a parent node )
F2 does not rename
What does work is
click node to select it
press F2 key
click node again - now I am able to type in a new name
It does the job, I suppose, but I don't want to have to explain this to every user.
wxWidgets v2.9, C++, windows
F2 doesn't work out of the box for wxTreeCtrl (it does work for wxDataViewCtrl though), you'll need to handle it and call EditLabel() yourself.
Double click is never used for renaming the items, only for activating them. What works for renaming is "slow click", i.e. a click on an already selected item which comes late enough to not count as a second click of a double click. This is how it works in the standard Windows treeview control and in wxTreeCtrl too.
Could you not just catch an event of type wxEVT_COMMAND_TREE_ITEM_ACTIVATED and then use wxTreeCtrl::EditLabel to start the editor?

Selecting button in Winform ToolStrip

Reference Image
I want to select a button("Exit") on the ToolStrip after pressing a button ("ButtonFocus To Exit") outside the toolstrip.
I used ExitToolStripButton.Select() on ButtonFocusToExit.Click but which seems like its selecting the button ("Exit") but when i pressed enter it never execute the code in "ExitToolStripButton_Click" .
So the button is still not active. Can anyone have fix to it?
Got the solution ...
First focus on the ToolStrip and then Select the Control on the Toolstrip
ToolStrip1.Focus()
ExitToolStripButton.Select()
Check if event is missing the event handler
Select the ExitToolStripButton > go to
properties > events tab> Click Event >
select the ExitToolStripButton_Click
You want to execute the ExitToolStripButton codebehind? You can call ExitToolStripButton.PerformClick();
Make sure it has focus. Are you sure the function you are using actually give the object focus? It could just give it the appearance of selection.
According to MSDN:
Select | Selects the item. (inherited from ToolStripItem)
It doesn't say anything about focusing it.