automation

Unable to extract processID from GetProcessId(.. hWnd) (pInvoke)

孤街醉人 提交于 2019-12-13 15:25:12
问题 im using the following method [DllImport("kernel32.dll", SetLastError=true)] static extern int GetProcessId(IntPtr hWnd); to try and get the processId for a running process and the only information I have is the HWND. My problem is that it is always returning error code 6 which is ERROR_INVALID_HANDLE. I thought i might change the parameter to be of type int but that also didnt work. Im not able to enumerate the running processes because there may be more than 1 instance running at any one

.NET Automation ControlType.Document: how to manipulate text?

最后都变了- 提交于 2019-12-13 15:13:37
问题 How can I set text into a ControlType.Document element using the System.Windows.Automation ? The ValuePattern is not available for Document ControlType and TextPattern doesn't allow setting of new values. This does not work: automationElement.GetCurrentPattern(ValuePattern.Pattern) as ValuePattern) .setValue(value); 回答1: I found an ugly way with this method: private void InsertTextIntoAutomationElement(AutomationElement element, string value) { object valuePattern = null; if (!element

Maximum number of excel processes?

人盡茶涼 提交于 2019-12-13 14:42:59
问题 If I do (for example) for (int i=0;i<22;i++) { var app = new Excel.Application(); } then 22 excel processes are created. However, if I do for (int i=0;i<25;i++) { var app = new Excel.Application(); } It creates 22 excel processes, but then most of them dissapear and only a few are left. Is there a limit of 22 or something? Can this be increased? Thanks! EDIT: with following code it doesn't occur: var apps = new List<Application>(); for (int i=0;i<25;i++) { apps.Add(new Application()); } 回答1:

Interacting with other applications (like clicking a button)

只谈情不闲聊 提交于 2019-12-13 14:31:10
问题 I'm trying to automate many repetitive tasks at work and this small problem got me stumped. We are using an application for printing out labels for online-orders, the process is like this. Click the order Check order details and Click "Finish" 5 seconds of the program calculating Confirm that you wish to print the label Label prints and you're done On busy days we gotta go trough this process for over 500 orders, because this task consumes a lot of useless time because of step 3. The user has

GetObject(, “Word.Application”) Office 365

不打扰是莪最后的温柔 提交于 2019-12-13 10:57:27
问题 After installing Office 365 my application code in vba is not working anymore Set wrd = GetObject(, "Word.Application") wrd.Visible = True wrd.Documents.Open "C:\My Documents\Temp.doc" Set wrd = Nothing Does someone has any ideas It does'nt recornize Office 365 with this code above but if i install Office 2016 or 2013 it works. 回答1: SOLVED ! Search in the registry for correct application name. On windows 7 you can find it in "HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\RegisteredApplicati‌​ons".

Vim function to update class definition to reflect current location

左心房为你撑大大i 提交于 2019-12-13 10:50:42
问题 I'm trying to take my vimscript to the next level. As a follow up to my other question about generating a class definition from a file path, how would you implement the following in vimscript? Given I have a file at lib/foo/bar/buz.rb that looks like this: module Foo module Bar class Buz ... end end end If I move the file to lib/cat/dog/cow/buz.rb , can I create a function to quickly update the file to look like this? module Cat module Dog module Cow class Buz ... end end end end 回答1: You can

How to SetUp Object Repository in Selenium?

谁说胖子不能爱 提交于 2019-12-13 10:39:07
问题 I am trying to setup an Object Repository in Selenium Webdriver in order to make sure that future changes in objects don't impact my script. 回答1: From my point of view PageObjects are the way to go. That simple! 回答2: Have a CSV with all the object locator's.... A CSV parser and store all the values in a multidimensional array with column and and row as index.. Use that array wherever you need to use the locater in the code... If you don't want to have the hard-coded index values for the array

Getting Error Of Connectivity In Appium Server

谁说胖子不能爱 提交于 2019-12-13 09:50:38
问题 info: [37m-->[39m [37mPOST[39m [37m/wd/hub/session[39m [90m{"desiredCapabilities":{"app":"D:\My_ALOHA\Appium\TestProject\apps\demo1.apk","platform":"VISTA","platformVersion":"4.4.3","platformName":"Android","deviceName":"AppiumDemo123","browserName":"","app-package":"com.livestrong.calorietracker","app-activity":"com.livestrong.calorietracker.activities.WelcomeActivity","version":"4.4.2"}}[39m info: [debug] The following desired capabilities were provided, but not recognized by appium. They

Automation email in Excel

空扰寡人 提交于 2019-12-13 09:45:22
问题 I am trying to design an excel file that will help my company with recruitment. The task is to create a sheet for candidates that the company speaks to, we will record all the records for the candidates including their first name, last name, mobile and email address. You can see a screenshot of how everything looks here: https://imgur.com/gallery/tvAIx As you can see there are columns for when the company speaks to the candidate and when he sends his CV to us. At the end there is also a "CV

How can I highlight element on a webpage using Selenium-Python?

孤者浪人 提交于 2019-12-13 09:24:45
问题 I have been handed over a existing selenium framework which uses python for scripting. For debugging(& other) purposes, I would like to highlight the element on which action is being taken currently (input box, link, drop-down etc.) Though I could find solutions to define a function and calling the function wherever I need to highlight the element(as examples given below), what I need is a solution at the framework level. Selenium webdriver highlight element before clicking https:/