automation

Virtual mouse for 1 internal frame

主宰稳场 提交于 2020-01-05 05:09:47
问题 I want to make a virtual mouse(pointer), that can be controlled by java only. But i cant find anywhere where i can do this? I want to make it draw a red dot as mouse. And i want it tosimulatie all mouse events. 回答1: I want to make a virtual mouse(pointer), that can be controlled by java only. one of possible directions import javax.swing.*; import java.awt.event.*; import java.awt.Graphics; import java.awt.Color; import java.awt.Component; public class SSCCE { private JFrame componentsFrame =

UI Automation: How to change value of a horizontal scrollbar AutomationElement

强颜欢笑 提交于 2020-01-05 03:52:07
问题 I am trying to change the value of a horizontal scrollbar from -1 to -2. I am able to get access to it.. but next i have to change its value.. AutomationElement _sideBar = _ClickButtonElement.FindFirst(TreeScope.Descendants, new PropertyCondition(AutomationElement.ClassNameProperty, "WindowsForms10.SCROLLBAR.app.0.378734a")); _clickButtonElement is the AutomationElement of the parent window of the scrollbar. 回答1: Scrollbars usually support RangeValuePattern. Use something like:

Bitbucket Webhooks

眉间皱痕 提交于 2020-01-04 18:15:31
问题 I want to automate the deployment of one of my projects onto my server. I m using git via bitbucket to version control my software. I came accross this this nice tutorial. Unfortunately i cannot get it to work. If i push changes from my local working copy, the remote repo gets updated but the webhook gives me the 404 error. So communication with my server was established but the script was not found. When i manually start the script via php bitbucket-hook.php a pull request is issued on the

Testng with multiple suites. @AfterSuite method closes driver after 1st suite and 2nd suite can't be run

梦想与她 提交于 2020-01-04 13:30:01
问题 I use testng for running tests. I have several test suites( Suite1.xml , Suite2.xml and Suite3.xml ), which are combined in one suite ( MasterSuite.xml ). Besides those, I have the class TestBase.java , where I configure such methods as @BeforeTest , @BeforeMethod , @BeforeSuite , @AfterSuite , etc. Running the @AfterSuite method closes the driver ( driver.quit() ). What I want: run MasterSuite which will run all my 3 suites one after another. The problem: after the first suite ( Suite1 ) is

Testng with multiple suites. @AfterSuite method closes driver after 1st suite and 2nd suite can't be run

冷暖自知 提交于 2020-01-04 13:29:49
问题 I use testng for running tests. I have several test suites( Suite1.xml , Suite2.xml and Suite3.xml ), which are combined in one suite ( MasterSuite.xml ). Besides those, I have the class TestBase.java , where I configure such methods as @BeforeTest , @BeforeMethod , @BeforeSuite , @AfterSuite , etc. Running the @AfterSuite method closes the driver ( driver.quit() ). What I want: run MasterSuite which will run all my 3 suites one after another. The problem: after the first suite ( Suite1 ) is

Scripting PDF Creation

孤街浪徒 提交于 2020-01-04 06:37:30
问题 I've been tasked with automating the collection of some reports from our remote locations. The machines are sometimes used locally by the staff at the location, and their usage is random. The software that generates the reports is somewhat limited and just allows us to print to the default printer. The department that's taking these reports doesn't want anything to change, and they enjoy getting their PDFs. I can programmatically change the default printer to use the PDFCreator printer (and

How to make python urllib2 follow redirect and keep post method

雨燕双飞 提交于 2020-01-04 05:42:25
问题 I am using urllib2 to post data to a form. The problem is that the form replies with a 302 redirect. According to Python HTTPRedirectHandler the redirect handler will take the request and convert it from POST to GET and follow the 301 or 302. I would like to preserve the POST method and the data passed to the opener. I made an unsuccessful attempt at a custom HTTPRedirectHandler by simply adding data=req.get_data() to the new Request. I am sure this has been done before so I thought I would

Automating old DOS application using Python

对着背影说爱祢 提交于 2020-01-04 04:00:51
问题 Is there a way to automate an old DOS application (16-bit, probably needs an emulator such as DOSBox) from Python (on Windows)? I would like to send keys and strings to the application, detect updates to the DOS "screen" and get the application output. It would be even better if the DOS application could run "hidden", i.e., not showing in the taskbar. Note: It is not a game, it is one of those old application where you are given menus with press 1 for something, press 2 for something else,

Automatically determine position of plot legend

半城伤御伤魂 提交于 2020-01-04 02:38:34
问题 You can position the key legend manually in most plotting programs. For example, in gnuplot it's done using set key top right . In ggplot2, it's done like this. Is there a plotting library, script, or simple algorithm that automatically positions the legend such that it overlaps the data in the plot minimally? What I mean is: Suppose I plot the line y=x . A good place for the legend in that case would be top left or bottom right. 回答1: Try this, require(Hmisc) ?largest.empty there are other

selenium file upload without <input type=“file”> element

有些话、适合烂在心里 提交于 2020-01-04 02:34:06
问题 I'm trying to upload my resume using selenium/python over here , under the Resume/CV Attach part. When I inspect the Attach element, it shows up as <a data-source="attach" href="#">Attach</a>. I'm not too familiar with HTML so I've tried finding the element by xpath, using send_keys() to upload the file but it runs through the program and doesn't upload anything. No error messages. driver.find_element_by_xpath('/html/body/div[1]/div/div[1]/div[3]/form/div[1]/div[10]/div/div[3]/a[1]').send