I've a very specific question:
How can I click in certain buttons on a web page?
Without that thing of coordinates. =D
What I really want, is a script that search for a Button (or more) with specific name and clicks it.
Imagine:
You open your browser and go to google page, than you run the script and, for example, it clicks the Search button.
If possible, I want a answer wich uses java or C#.
Thanks in advance for reading this,
and sorry for my bad english.
Edit:
Ok. Assuming that I'll use WatiN, can you rapidly explain how do I "put" this on my c# prog?
I want WatiN to be running on a button_click event. Like: When you enter the URL on my prog and press "OK" the prog will click that especific button that I've told you before.
Sorry if I've messed it up, I'me a truly noob with great ideas =s
For .NET, WatiN will do what you want. In fact, the very first example on the home page, shows you how to search google.
I WatiN all the time for screen scraping web sites: http://watin.sourceforge.net/
Related
I am currently working on an automation project.
Mainly everything is coded in powershell as the project involve AD, Exchange etc.
Last part involves integration to a website to fill a form. I have used document.getElementByID() and everything is working perfectly, but when I click the last button: Approve a popup shows up:
Window text: Message from webpage
Text: Are you sure?
Buttons: OK, Cancel
My question is, how can I answer a Messagebox generated by website?
I've looked through the DOM Explorer but can only find the Approve button, no child elements or anything.
Any help would be appreciated.
thanks DavidG, i figured it was all i java.
Found my way through the code and got i all working by simply ignoring the popup message and go directly to next step.
I am attempting to create a 'find on page' search option for a wp7 webbrowser control named 'TheBrowser' (using the standard webbrowser control in Visual Studio). I have done a lot of research but have not found much in the way of an example or sample where this was implemented. Essentially I will just be activating the search on a click event, from a textbox where the user may type in a word to search in the current webpage. I would also like to highlight the matched words as seen when doing a find on page search on a desktop browser.
I believe that to create this 'find on page' option I should use javascript to search through the lines of text, and then somehow highlight matched words. I have already implemented forward, back, and refresh buttons using TheBrowser.InvokeScript, but I do not know how to format for searching through the entire webpage (I have never done anything like this before). Any advice or assistance would be greatly appreciated, including code samples as I am completely new to this subject! Thanks in advance for your help and hard work!
Try jquery, this should do the trick: http://hugoware.net/blog/more-jquery-magic-search-highlighting You'll just need to inject the jquery script into the page.
I am developing a winform app which is controlling a website. On click of a button in winform app i want to fill a form, click the submit button on the web page upon which a new page will open , on that page i have to click on a link.
How to achieve this. i have tried many things but did not got any proper solution
If you're looking for a web automation tool, use Watin. It allows you to automate via code the opening of a browser, the clicking of buttons, and the fillout of form fields. However, that is more of a testing library.
Honestly though, your choice of solution sounds odd. You're trying to get a client application to make requests through a web page, instead of directly requesting whatever resource yourself from the client application. It's hard to give you a direct solution without a good understanding of the problem space.
is it possible to take a screenshot of what a textbox holds when the user presses the sumbit button for example?
EDIT: this is an aspx webpage
In short, no it is not possible to do this in a consistent, cross browser fashion (that I am aware of). If your textbox was implemented inside of a flash movie, it would be possible to take a 'screenshot' of what the flash movie was displaying when a button was pressed (discussion on this subject available here). But otherwise, you are going to have to do this processing on the server.
You could simulate this process by having the server render a copy of the page itself (feeding it the data the user entered) and then doing what you wanted with it from there. There are free and paid for solutions to assist you in taking a screenshot of a website (browse options available here).
On the client side I think you're stuck with the limitations of javascript, which might not be possible. Here is another question that is very similar to yours:
Take a screenshot of a webpage with JavaScript?
In the general sense, no, you can't. However if you have a constrained environment (e.g. kiosk, intranet), you can create a browser plug-in which can essentially do anything, including snapping a screenshot and sending it to the server.
If you have lots of control over the environment, you can create your own web browser which can take screenshots. In fact, I've done this with C#. I just wrote an app that hosts a browser control and sends screenshots to the server on certain key presses or at a user-defined interval.
I'm developing an application in C# using visual web developer. I'm displaying some text for reading and I want the user to be able to select a word or fragment, and then right click it to display a customized menu (One that has for example define, search, show grammar...). I
I don't know how to do it. I'm fairly new to the .Net
Thanks!
You have to do that entirely on the client-side, in JavaScript.
Note that it's considered a bad idea to take over right-click, which the user has the right to expect will work the same no matter which application they are using.