load a web page and click a button using c#

最后都变了- 提交于 2019-12-10 18:46:25

问题


I have a requirement to automate a procedure on a web page.

  1. Open a web page
  2. Find an input
  3. Click on it
  4. Close the web page

I would like to achieve all of the above using c# in a console application. I dont want to open any browser, but just a code to automate this process.

I have a URL to a web page and also ID of an input element.

What c# code should I use to achieve this.?


回答1:


I think this probably would be able to serve the purpose.

Selenium 1 (Selenium RC): The Selenium Server which launches and kills browsers, interprets and runs the Selenese commands passed from the test program, and acts as an HTTP proxy, intercepting and verifying HTTP messages passed between the browser and the AUT.

Selenium Server receives Selenium commands from your test program, interprets them, and reports back to your program the results of running those tests.

The RC server bundles Selenium Core and automatically injects it into the browser. This occurs when your test program opens the browser (using a client library API function). Selenium-Core is a JavaScript program, actually a set of JavaScript functions which interprets and executes Selenese commands using the browser’s built-in JavaScript interpreter.

The Server receives the Selenese commands from your test program using simple HTTP GET/POST requests. This means you can use any programming language that can send HTTP requests to automate Selenium tests on the browser.

For More: You can visit Selenium



来源:https://stackoverflow.com/questions/31780449/load-a-web-page-and-click-a-button-using-c-sharp

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!