tamaradepaus
12 years agoNew Contributor
Selecting invisible item in drop down list (jscript)
Hi,
I'm currently testing a webapplication which has a dropdownlist which shows at selection about 6 items. The amount of items and the location of the items is variable.
I would like to create a script in Jscript which selects the correct item from the box, whether it's already visible or not.
At the moment I've got this script, but it only works if the item is in the top 6 list.
function SelectMerchant(){
var page = Sys.Browser(BrowserType).Page(BaseURL).NativeWebObject;
var account = page.Find("innerText", "Select an Account");
account.Click();
var merchant = page.Find("innerText", "Sound of Data");
merchant.Click();
}
Can anybody help me out with this? Thanks in advance.
I'm currently testing a webapplication which has a dropdownlist which shows at selection about 6 items. The amount of items and the location of the items is variable.
I would like to create a script in Jscript which selects the correct item from the box, whether it's already visible or not.
At the moment I've got this script, but it only works if the item is in the top 6 list.
function SelectMerchant(){
var page = Sys.Browser(BrowserType).Page(BaseURL).NativeWebObject;
var account = page.Find("innerText", "Select an Account");
account.Click();
var merchant = page.Find("innerText", "Sound of Data");
merchant.Click();
}
Can anybody help me out with this? Thanks in advance.