Forum Discussion
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.
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
- 60 minutes ago
- 23 hours ago
- 3 days ago