Drop down in UFT - hp-uft

I am trying to select values from a drop down in my application. Drop down is getting identified as WebEdit in UFT.
Here is the line of code:
Browser().page().WebEdit("html tag:=INPUT","name:=WebEdit").Set "Add Document"
Add Document is a value in dropdown. Apart from "Add document" value, there are more values in drop down. please suggest how can i select those values one by one.
Thanks.

it should be WebList Object in Web application if it's a Dropdown.
I guess it's a Text Box Only in which if you click, multiple suggestion come like MakeMyTrip .
if it's the case you can use two approach.
1) Browser().page().WebEdit("html tag:=INPUT","name:=WebEdit").Set "SomeValue"
or
2) Browser().page().WebEdit("html tag:=INPUT","name:=WebEdit").Set "Someval"
' Then There will be Multiple Sujjestions, Which are nothing but WebElement.
' just click that WebElement

You can use descriptive programming to select values.
That way UFT won't select it as textbox implicitly.
Let me know if you are still facing issues.

From my experience, I guess the drop down you mentioned should be a dynamic one, Meaning a drop down will appear when you type words in that WebEdit column.
If so, my suggestion is that you can write a function to locate object's location (i.e. x,y property), and simulate mouse click the object. Now the object has been activated and you can type words. Use SendKey method to type some keywords you want to select, and use SendKey to press Enter to select it.
It's an ugly solution but sometimes it helps...

Related

MS Access trying to link a record with a page tab

I've been searching for a few days and doing every word combination I can think of to try to find the answer to my issue. I'm hoping someone can help me.
Before I begin I'd also like to say I'm very new to Access and admittedly not great with it. I'm still learning so this could be a very easy fix or I may have messed up beyond belief.
The issue I'm having is I've setup several page tab on a form and entered all the information for my records. However I cannot get the page tabs to pull up the corresponding records. Instead I have to either search through the records which doesn't always work or I have to arrow to the right record after selecting the tab I want. I'd like it so that when I click the tab it brings up the proper record automatically. If someone can point out where I'm going wrong and how to fix it I would greatly appreciate it. See below for some pics of what I mean.
As you can see in the first image. The tab name "Auto PLUS" doesn't bring up the proper record. instead I have to manually change the record using the arrows at the bottom of the form (see the arrow at the bottom of the image) in order to change the record. I need the record and the tab to match. Any help would be so greatly appreciated.
Thanks in advance for any help!!
-Deke
Assuming your form is bound (if in design mode your fields do NOT say "Unbound" then your form is bound), you simply need to add some VBA code to each tab's OnClick event.
Enter design mode and select the first tab "Claims Other". Open the properties pane, click the event tab, and click the ellipsis at the end of the OnClick line. When prompted, select "Code Builder" and it should launch the Visual Basic Editor.
It will put your cursor automatically in the correct position. Copy/Paste:
DoCmd.GoToRecord acDataForm, Form1, acGoTo, 1
The 1 should correspond to "Claims Other's" proper record in your table. Use the row number, not the ID number to determine what it should be.
Go back to Form View and click on the "Claims Other's" tab. The data should show the corresponding record in your table.
Repeat the steps of adding events to each tab, finding the relevant record in your table, and replacing the 1 from the above code.

Watir clicking nested elements inside a container

I'm trying to complete a happy path e-commerce payment test but I cant seem to click on the nested element for credit card to be honest I'm not entirely sure which is the clickable element.
Any help to get this working would be appreciated.
When inputting forms, you typically want to interact with input and select elements. In this case, you can see that the visible input field is a radio button - ie <input type="radio">.
You access radio buttons using the radio method and select it by using the set method:
browser.radio(id: 'cc-payment').set
The element you want to click is the input with type radio. You should be able to do something like:
driver.find_element(:css, "input[id='cc-payment'][value='creditCard']").click
I'm curious if clicking on the parent item would resolve.
#browser.input(id: 'cc-payment').parent.click
If the div registers the click and sets the input then this might work. You should be able to manually verify this beahviour by clicking outside of the radial and seeing if it selects.

Is there a quick way to set a visiblity expression for many rows in a SQL Server Report Services RDLC report?

I have a report with many tables (tablixes?), in which I need to hide all rows that don't have a value in the 2nd column:
I can do this by right clicking on each row
and setting an expression for the visibility of the row that depends on a value appearing in the field of the 2nd column, e.g.
=IIF((Fields!MyField4.Value = ""), True, False)
But the problem is that my report has over 1000 of these rows! It will take a very long time given that each field has a specific name! I can modify the Xml, but this will also take a while. I am currently writing some code, which uses XDocument, to achieve this.
Are there any faster ways that anyone can think of? Maybe something from the designer, or some VB code? Everywhere on the internet seems to suggest right clicking one row at a time.
In the Designer, select all of the rows (using your Shift or Ctrl key), and use the Properties pane in VS/BIDS to change them all at once. There is a Hidden property there, and you can choose Expression from the dropdown in it. From there, you can apply the IIF to all rows.
Of course, I am assuming all of the visibility is based on the exact same expression for each row. If not, then the answer is no. Unless, you want to start doing some copy/paste stuff in the RDL XML, which I do not recommend.

Add a textbox against a radio button to BIRT report parameters window

In BIRT, the report parameters window that pops up for user input ,I am taking two radio buttons. For the first radio button ,I am giving 'ALL' to select all office codes.
For the second radio button , I want to add a text box where the user can give one particular office code as input.
I would like to know how to add a text box against a radio button.
Thank you in advance.
I believe it is possible to do as you ask, but it would require creating a custom parameter. This is an easier solution for what I imagine is what you are trying to do.
The easier solution use a single text box in your parameter, set the default value to "All" and SQL code in your query similar to this.
where CONTCTSM1.OPERATOR_ID = ?
or
('All' = ?
and
CONTCTSM1.ACTIVE = 'f' )
With this code if a specific value is given it returns results for that one parameter. If the Value is left as All, then it returns all values where CONTCTSM1.ACTIVE = 'f'

Do not select a default value for a dropdownlist in sugarcrm

When generate a list of radio (with a dropdownlist), it will select a default value automatically.
But I do not want to select any values as default, how to set this?
Thanks.
The only way to solve this from Studio is to add an empty row to your drop down list. If this is not preferred, then I would follow Jim's suggestion to affect all the drop downs to not contain a default value. To get the wanted affect to this single drop down then JavaScript code would be the proper tool.
Thanks.
It will be radio buttons. Not a drop down list.
As far as I'm aware there's no way to set this in studio.
You can set this in the database as a quick and dirty fix:
UPDATE fields_meta_data SET default_value = '' WHERE id = 'IDOFCUSTOMFIELD';
Nicer, but more involved would be to create a custom version of
modules/DynamicFields/templates/Fields/Forms/enum.tpl
which allows choosing no default value.
One way we've done this by adding a value in studio of "please_select" with a display label of "-please select-" and make this the default.
This way it's obvious when staff are looking at the record that it's not filled in, and we use workflows and reports to catch the exceptions and raise the alert to the appropriate person/s.
I have found a solution to this, although I would like to stress that I would not recommend this as a best practice.
I was using SuiteCRM 7.2.3, and Sugar 6.5.20. So not sure whether this will work in later Sugar Versions.
Create a Radio Drop Down Field
Create your drop down list
Save it
Go back in the dropdown editor and find your dropdown list: In my
example, I had options, 0, 1, and 2.
Create the same options again only as 3, 4, and 5.
Now delete options 0, 1, and 2.
Save the dropdown
MAKE SURE you don't save the field again after you do this, only the dropdown list.
Now go look at the field in the EditView and you'll see that no option is selected. Worked every time I did this. Nothing shows up in the DetailView, so I'm assuming NULL is being passed to the DetailView in this instance, but I'm not 100% sure.

Resources