How to deselect all items in a combobox? - vbscript

I have a drop down combobox that I need to deselect all of the options in there.
I've tried selecting every item using the select option and making it equal to false, it's not working, I also tried doing the same with getItem.
For It = 1 To wpfwindow("window").WpfComboBox("randComboBox").GetItemsCount -1
wpfwindow("window").WpfComboBox("randComboBox").select(It) = false
I want everything to be deselected

I don't think WpfComboBox supports having no element selected. From a look at the documentation of WpfComboBox.Select I see two problems with your code.
(major) Select selects an item, it doesn't return a boolean saying whether it's selected, so settign it to false won't do anything.
(minor) It says that The first item in a list is numbered 0 so starting It with 1 is an error (if you start with one you should end with GetItemsCount not with GetItemsCount-1).

Related

Fetch offset cell from regexextract on different sheet tab if data validation equals certain value

I have searched around but can't find anything that gets me quite there. I have tried various methods but can't get it.
Sheet A - has Tab 1 and Tab 2
In Tab 1, cell O22, I have a data validation list of items. Depending on the item I pick, I want the cell below - O23 - to check a column on Tab 2 and find the phrase from cell O22.
When the phrase is matched then get an offset cell one to the left of the matched value on Tab 2 and return that result into cell O23.
This is because I am using the data validation to allow for a choice of items and ultimately return a URL which is then fed into a Google Sheets app script. I've tried using indirect, offset, address etc but I keep falling short.
Any tips would be appreciated.
EDIT: An example copy is here: removed - thank you.
use VLOOKUP
=IFNA(VLOOKUP(O22, {Sheet2!E27:E29, Sheet2!A27:D29}, 2, 0))

How to click on Web Table column's Web Button in following case?

I have one web table, in this I want to delete particular record by clicking on record's delete button.
I got the value of row but I am not able to perform click on web button of particular row and also there is 2 buttons in one column.
How to click on delete icon of particular row?
You need to set a reference to the item within the specific row and then click on it - something like this:
Set oLink = Browser("myBrowser").Page("myPage").WebTable("myTable").ChildItem(iRow,8,"Link",0)
oLink.Click
You will potentially need to amend the "Link" and the number 8 in your own code. iRow represents the row you are trying to interact with.
Essentially what this code does is set an object reference to the first item of type "Link", in column 8 of the table, then uses a Click event to select it. If your delete icon is a WebButton, then replace "Link" with "WebButton" for example. The final 0 in the command tells UFT to select the first element matching the object type - you might need 1 if your two icons are in the same column of the table.
Let me know if that helped.

Select multi items all at once in Kendo UI Multi-Select?

When use multi-select control in Kendo UI, it seems we have to select items one by one, i.e. click one item, the drop down list will collapse, then we have to click the multi-select control again to select the next item. Is it possible that when drop down list drops, user can select multiple items at the same time, so multiple items can add to the control at the same time, i.e. use CTRL + Mouse to select multiple items?
For example, in the below image, I want to select Nancy and Robert (i.e. use CTRL+MOUSE) and add them to list at the same time. Is it possible?
Thanks
Set autoClose to false:
$("#multiselect").kendoMultiSelect({
autoClose: false
});

Enable/Disable APEX dynamic action

I have a form which has 4 items:
A yes or no fill in
2 items if yes
1 item if no
I would like to create a dynamic action that would disable the field(s) that I do not need, enable the one(s) that I do need, and set the focus to the (first) enabled item. Additionally, it should be able to switch back and forth without a page refresh.
I tried making a couple of dynamic actions, but I noticed that it would only change once. For example, if I were to enter 'yes' into the first field, it would enable and disable the appropriate fields, but when I would switch the first field to 'no', nothing would changed.
Any help would be greatly appreciated. Thanks in advance.
It sounds like you need to fill in the Condition field (in the When sction) on the dynamic action and then include a True Action and a False Action.
For example:
Condition equal to 'Yes'
True Actions: Display 2 items
Hide 1 item
False Actions: Hide 2 items
Display 1 item
If this doesn't resolve your issue, you should try listing the values you have used for all the fields on your dynamic actions. Without seeing the values, it is difficult to troubleshoot.

Not able to uniquely identify a checkbox in qtp

I am working on a windows form .Net application using QTP and there are a set of checkboxes which are repeated and all have the same property.I need to select the one particular checkbox from each set.If the checkbox is not visible on the screen then we need to scrool down else in pops a error message.Is there a way to select one particular checkbox from each set.
eq:
abc feature
1
2
3
abc feature
1
2
3
4
abc feature
1
2
i need to select checkbox 1 from all the set.
You need to find a way to identify a "checkbox set" use the object spy or a dom inspector to see what identifies the set (probably some kind of div or span) for the sake of this answer I'll assume that it's a div with a specific class "chkbxGrp".
Then look for the first checkbox contained within this group and check it.
Note that scrolling the checkboxs into view is done automatically by QTP.
If you need to fail this when an expected group doesn't exist you will have to find out how to identify specific groups and then use the expected values in the test rather than iterating over all such groups.
' Untested code
Set Desc = Description.Create()
Desc("html tag").Value = "div"
Desc("html tag").RegularExpression = False
Desc("class").Value = "chkbxGrp"
' Find all groups
Set groups = Browser("B").Page("P").ChildObjects(Desc)
For i = 0 To groups.Count -1
' in each group check the first checkbox
groups(i).WebCheckBox("index:=0").Set "ON"
Next
You can "identify" the checkbox using QTP index.
It's not the best option to do, though if you need only the 1st checkbox.
Just look for all Objects on the page of a type "CheckBox", and if the result set > 0, get the first one.
The second option is to "locate" the Checkbox by the nearby elements, but in this case you need to be sure that their location is NOT to be changed.
BTW, are you sure they are completely identical? In QTP there is an option to set necessary attributes for elements location. You can add any attribute which is unique for the CheckBoxes appearing in your app.

Resources