I've looked but i cannot seem to find an 'Open New Tab' option for the robot framework. I've seen things that are close but not quite what i want. The goal is to be in one tab, do something that would send an email, and then open a 2nd tab to check the email. I'm using BrowserStack so a second window is not an option.
I attempted to use the image horizon library to send a Command+T but it ends up performing that command in whatever window has focus at the moment. When running from the terminal, it'll open a new terminal tab instead of sending the combination to the browserstack window.
Related
modal popup and marked blue left below
Is there any way to block modal(? - this is my understing for the box) popup automatically? I'm working on Mac, The bule color marked in left below is saying "do not open one day". I clicked check-box but it shows continuously. My searching result is such popup is called modal/layered popup - I have no idea for such technology. Please help how to block or click automatically by using Pythoin, javascript or Apple script. I'm using Keyboard maestro app so I can put such code before or after opening site which has modal(?) popup. I need to open 8-10 sites so need help.
tried to remove cookies but appear continuously. I think it's better click check-box automatically. Alternative if any is also good if can click "do not open one day" checkbox automatically.
I would like to make a program for make my window refresh every 10 min. i'm new to programming and currently exploring python technology
My machine is connected with pc based software which will test the product
The software tend to be freeze and system hang-- we need to restart the pc to solve this issue
idea:
I want to make a python program to auto run and keep click refresh button every 10min
my idea is to keep window always ready to receive data
I just beginning to explore below code ( very simple)
import mouse
#left click
mouse.click("right")
mouse.wheel(-3)
# right click
mouse.click("left")
How do I access the "refresh" option on the right click?
is my idea in not particle?
Your question is very unclear, so I'm just guessing you are in a browser window and want to refresh the site (right?)
Using the mouse package to do so will be very hard, therefore I suggest you use the keyboard-package, which is even from the same author.
import keyboard
keyboard.send("F5")
I am making application that controls a browser with SendKeys. But as SendKeys get the full control over the keyboard, I want to run this app under the different user. This way I will be working, the application will do what it have to do, and we will not make problems for each other).
The simplest code is
import time
import SendKeys
time.sleep(10)
SendKeys.SendKeys('hello')
I run it, focus on the field where I want to insert my text "hello", and wait. If I don't change the user, all is done as expected.
But when I run it, change the user and return after 10 seconds, I see that SendKeys sent nothing to the program.
How to send keystrokes to the program under the different user?
(I was trying to do the same with pywinauto, but the result was almost the same - all is good if I don't change the user, and error if I change it. So I thought that it is much simplier to resolve this problem with only SendKeys).
Just to summarize our discussion in comments and in the chat. Your wishes are very wide. I'm just trying to show you some directions to learn.
If you want to use SendKeys/TypeKeys/ClickInput methods (working as a real user), you need to run your automation script in the remote session, not locally. This is explained in details in my other answer: SetCursorPos fail with "the parameter is incorrect" after rdp session terminated.
If you want to run the automation on the same machine silently (in minimized state), there is an example for dealing with hidden windows: Python - Control window with pywinauto while the window is minimized or hidden. Just minimize the window and use silent methods (almost all except ClickInput and TypeKeys).
Feel free to ask more detailed questions about pywinauto and GUI automation.
I'm on OSX using Python 2.x, Selenium & Firefox
I'm automating testing a javascript webapp with Python & Selenium.
One of the links (Add File) in the application opens up a non-browser firefox window titled "File Upload" which looks like (/is?) a Finder window.
Is there a way that I could locate and control this window from my python script? I know Selenium can't do it, but I wondering if it might be possible with something like 'import applescript' and if so how?
I found atomac which allows me to control mac apps through their accessibility controls (which needed to be enabled on Mavericks for Aptana in System Preferences -> Security & Privacy -> Privacy -> Accessibility). Cool tool, but the documentation is pretty sparse. The examples provided on the page above got me to the point where I could close the window via the cancel button, but I had to review the function definitions in atomac's AXClasses.py to figure out the rest. Here's the solution.
import atomac, time
from atomac.AXKeyCodeConstants import *
# to allow me to make firefox frontmost while testing
time.sleep(5)
# get a reference to the running app
firefox = atomac.getAppRefByLocalizedName('Firefox')
# get the window of the reference
firefoxwindow = firefox.windowsR()[0]
# send key sequence to go to my home folder
firefoxwindow.sendKeyWithModifiers('h',[COMMAND,SHIFT])
# send key sequence to select first file there
firefoxwindow.sendKeyWithModifiers('a',[COMMAND])
# press the now active Open button
openbutton = firefoxwindow.buttons('Open')[0]
openbutton.Press()
It's theoretically possible, but really awkward. I'll give you a bunch of links--not ideal, I know, but you could write a book on this.
You'd need to start by enabling AppleScript control of the GUI. Then you'll want to read up on how to control the GUI from within Applescript. However, you wanted to use Python and not AppleScript, so then you'll need to install PyObjC, which is a Python to Cocoa bridge. You'd need to use the Scripting Bridge framework and figure out (from the extremely thin documentation) how to translate the AppleScript docs to Python.
I am using PAMIE to auto log in to websites and I have a couple to do. I got the scripts down to do this but I can't get PAMIE to open a new IE window so when I run the script it just opens one logs in and then when the next one is open it closes the first and opens the second and so on. So how do I get PAMIE to open new windows. This is what I have..
website="https://website"
ie.navigate(website)
ie.setTextBox("username","Myusername")
ie.setTextBox("password","mypassword")
ie.clickButton("btnSubmit")
Then I want to do this again but need it in new window.
website="https://website"
ie.navigate(website)
ie.setTextBox("username","Myusername")
ie.setTextBox("password","mypassword")
ie.clickButton("btnSubmit")
I tried ie.new before navigate(website), if someone could please tell me what command to open a new window I would appreciate it. I have also trie ie.change.window, and can't get it to work. Thanks
The web page is being re-opened in a single IE instance, because you're only using one PAMIE instance. If you really want multiple IE windows open, you can use multiple PAMIE instances.
Here is one very simple and crude example. Note that your import line may be slightly different than mine.
from pamie30 import PAM30
ie1 = PAM30.PAMIE("http://www.google.com")
ie2 = PAM30.PAMIE("http://news.google.com")
So now you can use ie1.navigate(), or ie2.navigate(), etc. to fill out the forms on your websites.
For example, to use the first IE instance:
ie1.setTextBox("q","my text goes here")
ie1.clickButton("btnK")
And when you're done with an instance you can kill it (it will leave the web page open, if you haven't done anything else with it), this just kills the Python object:
ie1 = None