简体   繁体   English

C#自动化ASP.NET网站

[英]C# to Automate an ASP.NET Website

I have a website to which I need to pass 4 parameters and then extract data programmatically but there is a big problem. 我有一个网站,我需要向其传递4个参数,然后以编程方式提取数据,但是存在一个大问题。 The website is built into ASP.NET with FORM inside AJAX. 该网站内置于ASP.NET中,并且在AJAX中具有FORM。 So, I can fill one field programmatically and then I fill second field. 因此,我可以以编程方式填充一个字段,然后再填充第二个字段。 There is a need to click a button in order to fill third field so I press button programmatically then. 需要单击按钮以填充第三个字段,因此我以编程方式按了按钮。 The problem is that when I click the button, the second fill gets empty before calling the button event and causes error. 问题是,当我单击按钮时,第二个填充在调用按钮事件之前变为空,并导致错误。

So is there a way I can sharply fill fields without causing errors? 那么有没有办法我可以在不引起错误的情况下急剧填写字段?

看一下诸如WatiN之类的Web自动化库-这使您可以进行这种交互。

我同意Oded的观点,并希望补充一下,将Selenium RCNUnit结合使用是一种选择。

I believe IRobotSoft web scraper can do this kind of work. 我相信IRobotSoft网页抓取工具可以完成此类工作。 You will use two form filling actions, and add a Click action between them. 您将使用两个表单填充操作,并在它们之间添加一个Click操作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM