how to set value in noneditable editbox by using QTP - javascript

in my web application some of screen completely deal with Js framework we are doing Automation with QTP plz help me on below issue,
Visualy weblist box if I click in that Edit box will activiate but it's completely Readonly+Non Editable if we click Dropdown Icon it will populate one window in their Tree type value(Ex:Class>>Branch>>Section) we need click Section and then press Set Button then selected values populating in the Edit box.
even though if i'm making Editbox property Readonly is false after entering the values in the edit box clicking submit button it's giving error Null value in that Edit box ?all these are developers completely written in Javascript Framework so is there way to directly entering values with out selecting Popup window values by using QTP(VBSCRIPT) or Javascript code?
Thanks

I don't exactly understand your question but it seems to me that one of the options you're asking about is how to run JavaScript code from QTP. You can do this starting with QTP11 using Page.RunScript (or Frame.RunScript).

Related

Text in textarea dissapear when auto populated with add-on Autofill

A page I am testing is built with react. On the page I have checkboxes and text areas. Now I am trying to use the Chrome plugin Autofill in order to populate the fields. The check box selection remains after I click on NEXT button (to go to next page) but the numbers that are written to the text areas disappear!
Anyone that has any ideas on what this could be?
I use simple javascript code that populates the text field and that works fine, I see the text but it seems like the page does not recognize it is populated when I click on Next button:
document.getElementsByName("price")[0].value=123456
I have also tried with
document.getElementsByName("price")[0].value="2500123"
Both lines populate the text area correctly but it disappears.
It is the same behaviour even if I use that javascript in F12. Still the text will dissapear when I have click on Next button. But not the check box selection!
When I enter 123456 manually I can continue with Next button.
All input is appreciated.

Getting dropdown selected value on change using DOJO script

Hi I am working on DOJO website and I need to get the dropdown selected value without redirecting to another page using DOJO script or Plain javascript(No jquery, because dojo website not supporting Jquery).
Here is my scenerio
View account
View payment
address change
FAQ
You want the value selected from a drop down box but the act of selecting the value in the first place causes a redirect? You mean the values are coded as links? If so then you need to find the code where the value is used as a link and write some condition to get the value rather than let the click redirect.
If you just want the currently selected value then you need to find the same code, where it was processed as a link, and set a variable there that you can use for your purposes.

Text box with a clear button inside in asp.net

I have a lot on my site text boxes whose content is a date
So I will not have to check correctness did it read-only
Until now next to each text box was two buttons, one to add date opened popup calendar, second to delete the date (values ​​not required)
Now I wanted to go to ajax calendarextender that the buttons were just ugly
My problem is that this control is not have delete button, and I do want to allow the user to deleted but not cancel the properties read-only to text box And I do not want to leave the ugly button.
My question:
If calendarextender ajax or something similar with a delete button from the popup
Alternatively if you have the option text box with a delete button inside( as text boxes IE10)
With the help of css and java-script you can easily do it.
Here is an example How do I put a clear button inside my HTML text input box like the iPhone does?
Instead of all that work to make it read-only and avoid validation, why not combine a FilteredTextBoxExtender with the CalendarExtender. Use the filter to block all non-numeric characters. I still think it's better to do the validation. It's as simple as DateTime.TryParse(), or you could do it client-side with the built-in FieldValidators.

ios - Injecting text into a UIWebView textField

Quick question - if a textfield in a webform, does not automatically has the focus set by the form, ie you got to press the field before the keyboard pops up - am I correct to assume that field cannot be edited then?
In other words - I cannot set a text for a textField by injecting javascript into it, unless it gets a focus upon loading of the website right?
NOTE: I am not talking about set texts or placeholders here:-)
Cheers
Yes you can! You can use Javascript to set the value:
[theWebView stringByEvaluatingJavaScriptFromString:#"document.getElementById('textFieldID').value = 'MyText'"]
Here's an article which shows you how to set and get the values of textfields with Javascript.
Hope this helped!

interesting select box case?

Ok i am trying to make a select box like this used in following website
http://www.buildasign.com/PowerDesign.aspx?T=72486B387A61516563704442304E344F3068766947673D3D
When you will open the website link you will see a default word "Go" as selected. On left
side of drawing window there is size option which is of 91 value. But there are some fix values in select which never change like 8,10,12. How he is keeping one field which doesn't show in select(This value 91 doesnot show in dropdown) but still appears in it. Any help will be appreciated?
In a browser such as chrome, inspect the element and you'll see the text "91" is in a textbox, overlaid over the dropdown list. This simulates a combobox. There are various combobox jQuery plugins: http://plugins.jquery.com/plugin-tags/combobox
It's not a standard select box. But a textbox with some predefined text that is shown as an AJAX select box (a .NET control renderes data as a select box but it's not HTML select form element! just looks like it).
Spolto is pretty dead on with this one. The author of the site just set the text that way.
If you notice, the "drop-down" is still text typable, so despite the options you can type any set of digits there!

Categories