Selenium RC- How to capture dynamic text from an image and type the same in a text box next to it - selenium-rc

I am new to Selenium and have been trying to learn it using a registration web page. In the registration page, I have an image which has dynamic text which changes everytime a new registration is done. This text has to be captured and typed in as is inside a text box which is verified for completing registration. In Selenium RC, while inspecting element, the verifyv alue option is disabled.
When I use verifytext, the text is displayed but not value inside the image. Can someone suggest in RC, how I would capture the value inside the image without a Verifyvalue option as this is disabled.
Thanks
S

You are talking about captcha, you can not automate captcha, as it is provided to avoid automation of functionality.
To automate captcha you need human interaction.
You can put break command or use input box, where you can type captcha value and then you can pass it to text box which is provided for captcha text.
For sample script you can visit
HERE

We write script but need to provide break point to insert CAPTCHA code manually. In this situation when script will be executed; every time CAPTCHA code must be entered manually. Use following script for that..
storeEval | prompt("Enter Captcha:") | varName
type | id=recaptcha_response_field | ${varName}

Related

Form in Joomla website to run script

I'm new to Joomla and quite newbie to websites in general.
I want to provide the user a form with a couple of text-input widgets and some check-buttons. After the user fill them and hit the "Submit" button I want to run a (python) script in the background. The script will collect some data from the internet and make a specific plot. The plot is embebed in a HTML document (I'm using Bokeh here), which I should present back to the user.
And I need some help to figure out how to do it.
Doubt number 1: I saw that there are some Form extensions around (e.g, Form Maker), but do I need them?
Doubt number 2: How do I trigger the execution of a (python) script on my system, wait for its return and access the output (let's say output is called 'plot.html')
Doubt number 3: The output (plot.html), should I present it on a new tab of the user's client or may I embed at this point in the page where the form is (below the form, for example)?
Thank you
You could start by creating a small Joomla module. In its tmpl/default.php file, just create the form in HTML as you would with any other form - have the form submit to itself.
In the module's entry point mod_mymodule.php, use a conditional to check the form has been submitted, then use one of PHP's program executions functions, such as exec, to run your Python code, passing in the needed variables.
Finally display the your output HTML in tmpl/default.php passing it as a variable in from mod_mymodule.php.

Automating web form submission on page with .gsp extension

I need to enter data into the following web form 2,700 times: http://sg.sensemaker-suite.com/collector/modifyfragment.gsp
I have a CSV file with all the data that needs to be entered into the form... basically an ID and a text field of several sentences. The process will be to enter the user name, password, language, and the ID. Click load. Enter a specific page number and wait for it to load. Enter field of text and click to save. Repeat this process with another line of data from the CSV.
I'd like to automate this process and would appreciate any suggestions for software or scripting resources? I've never done this before so the simpler the better. I have a comp sci background (used C/C++, Java, PHP) but have not programmed seriously in years.
Thanks!!

How to encode the kendo editor field?

I am using the kendo editor. If I write any html data like : <img src=x onerror=alert(0) > as an input. The script is getting executed. Means the kendo editor is not secure. How I can encode the value on client side ?
Thanks in advance.
I don't think the problem here is so much that the Kendo editor is insecure, more that the javascript fragment has made it onto the page in the first place.
On initialization the Kendo editor merely copies the input value verbatim and uses it within the iFrame that is contained within the editor, hence the script executes.
Typically you would encode/sanitize user content server-side before it's displayed. It's your website that generates the HTML page so you have full control over the output and need to ensure that a potentially dangerous value doesn't get added to the input's value in the first place.
It might be worth looking into Microsoft's AntiXSS offering.

Set breakpoint to event in google chrome debugger

Sorry if this question was mentioned. I have web page with bunch of javascript files. One of it has function that sets value to some input on HTML file. Is it possible to see via debugger which javascript function invokes changing of value of the input HTML element?
Right click on the input tag that you are willing to observe and select Break On and then Attribute Modifications. Your scripts will stop if they try to modify the input value.

Adding Hyperlinks to created Bookmarks in a Word documnet using Ruby

How do you add a Hyperlink to a word document using an existing bookmark. I have been testing using IRB but continue to get Command Failed.
I have attached to a running word application have text selected that I want to tie to the hyperlink. For testing I have been trying to just add a google hyperlnk. I figure once I get that then I would be able to figure out the bookmark. This is the command I am using
doc.Hyperlink.add(word.selection, 'http://www.google.com', '','','text to display')
The two blank parms are for SubAddress and ScreenTip respectivly.
Luke-
You're very close...
Change this...
doc.Hyperlink.add(word.selection, 'http://www.google.com', '','','text to display')
...to this...
doc.Hyperlinks.add(word.selection.Range, 'http://www.google.com', '','','text to display')
There were two changes necessary:
(1) You call the Add method on the Hyperlinks (plural) collection, and (2) the first argument needs to be a Range object.
With these changes, your code works for me.

Resources