Forum Discussion
Can you create a separate function, just to perform the ClickItem("GCT_1291_AUTO") ?
Also, what technology does your web application use?
A number of people are having similar issues, but neither of them have mentioned the technology used. I've tested this against Bootstrap, and standard HTML, and it works fine.
- Semirxbih7 months agoContributor
The web application is built using:
- Java for the back-end.
- React for the front-end.
- This is a spring boot application.
We are using TestComplete to write BDD tests using JScript.- rraghvani7 months agoChampion Level 3
Could you go to https://www.w3schools.com/tags/tryit.asp?filename=tryhtml_select and then run the following JavaScript sample,
function SelectItem() { var page = Sys.Browser().Page("https://www.w3schools.com/tags/tryit.asp?filename=tryhtml_select").FindElement("#iframeResult"); var listbox = page.FindElement("//select[@id=(//label[.='Choose a car:']/@for)]"); listbox.ClickItem("Audi"); }
Is the correct item 'Audi' selected?
- Semirxbih7 months agoContributor
Correct, it does - Audi is properly selected.
However, I do see that "Audi" is the value, which makes things easy to select, but we auto-produce values and use the "Dropdown Field Name", such as:
<option value="dsgfdhgty65yhghgf">GCT_1291_AUTO</option>
That seems to be an issue, unless we can update this function to differently target it:function import_selectConfiguration(name, description, customerCode) {
waiter(SHORT_WAIT);
var configName;
var select = popupWindow.FindChild("ObjectType", "Select", MED_DEPTH);
var configList = aqObject.GetPropertyValue(select, "ContentText").split('\n');
var exactMatchFound = false;
for (var i = 0; i < configList.length; i++) {
if (configList[i] === configName) {
select.ClickItem(configName);
Delay(5000);
if (select.wText == configName) {
Log_Message("Found and selected configuration: " + configName, STEP_NORM);
exactMatchFound = true;
break;
}
}
}
return true;
}
Related Content
- 2 years ago
- 2 years ago
- 2 years ago
Recent Discussions
- 3 days ago