automation

Automatic download file from web page

心已入冬 提交于 2019-12-18 07:19:00
问题 I am looking for a method to download automatically a file from a website. Currently the process is really manual and heavy. I go on a webpage, I enter my pass and login. It opens a pop up, where I have to click a download button to save a .zip file. Do you have any advice on how I could automate this task ? I am on windows 7, and I can use mainly MS dos batch, or python. But I am open to other ideas. 回答1: You can use selenium web driver to automate the downloading. You can use below snippet

Opening a new tab in the same window session of the browser through Selenium WebDriver?

纵然是瞬间 提交于 2019-12-18 05:24:09
问题 How to open a new tab in the same window session of the browser through Selenium WebDriver command? 回答1: Opening a new tab in the same browser window is possible, see solutions for Firefox: How to open a new tab using Selenium WebDriver with Java? Controlling firefox tabs in selenium The problem is - once you've opened a tab, there is no built-in easy way to switch between tabs . Selenium simply doesn't provide an API for that. Instead of a tab, open a new browser window. 回答2: Yes you can do

Word table with borders

你说的曾经没有我的故事 提交于 2019-12-18 05:21:21
问题 The following code inserts a table to the Word document: using Word = Microsoft.Office.Interop.Word; ... object oMissing = System.Reflection.Missing.Value; object oEndOfDoc = "\\endofdoc"; Word._Application oWord; Word._Document oDoc; oWord = new Word.Application(); oDoc = oWord.Documents.Add(ref oMissing, ref oMissing, ref oMissing, ref oMissing); Word.Table oTable; Word.Range wrdRng = oDoc.Bookmarks.get_Item(ref oEndOfDoc).Range; oTable = oDoc.Tables.Add(wrdRng, 3, 5, ref oMissing, ref

Automate daily csv file download from website button click

非 Y 不嫁゛ 提交于 2019-12-18 05:14:15
问题 I would like to automate the process of visiting a website, clicking a button, and saving the file. The only way to download the file on this site is to click a button. You can't navigate to the file using a url. I have been trying to use phantomjs and casperjs to automate this process, but haven't had any success. I recently tried to use brandon's solution here Grab the resource contents in CasperJS or PhantomJS Here is my code for that var fs = require('fs'); var cache = require('./cache');

Automating Visual Studio instance from separate process

情到浓时终转凉″ 提交于 2019-12-18 05:13:34
问题 Is there a way to write an application that can connect to a running instance of Visual Studio and issue commands to it? For example, could I write a WPF app with a button that, when clicked, issues a "Build.BuildSolution" command to an already-open instance of Visual Studio, causing it to start a build? I'm sure I could use SendKeys to send Ctrl+Shift+B, but I want to know if there's a way to write to an actual API to automate Visual Studio, and invoke commands by name. 回答1: Here's a C#

How can I respond to prompts in a Linux Bash script automatically? [duplicate]

两盒软妹~` 提交于 2019-12-18 04:44:15
问题 This question already has answers here : Have bash script answer interactive prompts (6 answers) Closed last year . I am running a script (I can't edit it), and there are three yes/no questions. How can I automatically respond to these questions? I need to answer yes, yes, no (in that order). 回答1: Try this: echo -e "yes\nyes\nno" | /path/to/your/script From help echo : -e : enable interpretation of the following backslash escapes 回答2: Pipe to Standard Input Some scripts can take replies from

Automated testing of GUI [closed]

佐手、 提交于 2019-12-17 22:18:35
问题 Closed . This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed 5 years ago . This question isn't about unit-testing. And it is for a desktop product. This is about testing of the gui and testing that the right stuff is input in the right text box at the right time. A company I used to work at used WinRunner (different department so I don't know much

Sinking Events of DWebBrowserEvent2 hangs the navigation

坚强是说给别人听的谎言 提交于 2019-12-17 22:01:36
问题 I have a problem just like JimEvans in Sinking DWebBrowserEvents2 events appears to hang programmatic navigation but I can't understand the anwser, can somebody tell me more about it?? I'm manipulating the IE Explorer by plaint C++. Some codes are copied from the Codeproject. But my IE got hung when I'm handling the Events, and I can't get the DISPID_NAVIGETCOMPLETE event before my main function finishes. My code below: #include <afxwin.h> #include <afxdisp.h> #include <iostream> #include

Why should I ever use CSS selectors as opposed to XPath for automated testing?

折月煮酒 提交于 2019-12-17 20:38:25
问题 Please help me understand why using CSS selectors are even an option for automated testing. I've been using the tool Ghost Inspector some in my workplace for creating lots of automated tests for our stuff. This tool gives you the option of using CSS selectors intead of XPath. Why? XPath is SO much more durable than CSS. The CSS on any given UI is subject to change almost weekly on some projects/features. This make the tests extremely brittle and prone to being broken regularly. Is it because

Cucumber Selenium using Excel File as Data Table

允我心安 提交于 2019-12-17 20:28:00
问题 I am using Cucumber-Selenium and Excel as my Data file, my question is how can I run my feature file multiple time based on the data I have on the Excel. For Example I have 10 rows of data in Excel and wanted to run it one by one, after the first row of data it will move to the next row and execute it. Feature File: Scenario: Login Given I open the browser and access this URL When I enter the "<Username>" and "<Password>" Then I am able to login Step Definition: public class Login { WebDriver