Selecting an option in drop down( md-select ) issue

Hi All,

I am new to this Katalon studio tool. I am trying this tool to test my web application which is using angular js with material design for the front end.

Created a test case to create a new user form but I am getting error when selecting a drop-down value and the error is below
(Root cause: org.openqa.selenium.support.ui.UnexpectedTagNameException: Element should have been “select” but was “md-select”

Please guide me how to overcome this.

Thanks

Hi Raj

You’re probably using one of the Select APIs, like https://docs.katalon.com/display/KD/[WebUI]+Select+Option+By+Index

Your angular app is likely using a component that looks like a select element, but is in fact something else (a span or a ul/li combination, etc.).

If you post some of your HTML, perhaps I (we) can help further.

Hi Russ Thomas,

Thanks for the reply. Here is the HTML code of this md-select drop-down field in my application

Can you suggestion this katalon studio tool for Angular js (with material design) application.

Thank you.

md-select.png

Sorry, while I know what Material Design is, I’m not familiar with testing it. That said, try using the WebUI.Click api to target one of those elements. Perhaps try the element, first. If that makes the of items appear, you’re all set to go.

// Selecting a Partner from the Dropdown
WebUI.click(findTestObject(‘QA2_OBP_OR/Page_AdminAccess - Online B/div_selectize-input items not-’))

//WebUI.delay(GlobalVariable.delayTime3)  
'Modify xpath of Partner dropdown'  
String partnerxpathval = findTestData('DF\_ExcelDataFiles-UA/2.DF\_TransactionPageTests-OBP-ALL-UA').getValue('PartnerXpath', row)

WebUI.println('partnerxpathval = ' + partnerxpathval)

clickPartner = WebUI.modifyObjectProperty(findTestObject('QA2\_OBP\_OR/Page_ LoadOnBoarding/Click\_Partner\_Value'),  
    'xpath', 'equals', partnerxpathval, true)

WebUI.println('clickPartner = ' + clickPartner)

'Focus on \\'Comment\\' field'  
WebUI.delay(GlobalVariable.delayTime2)

KeywordLogger log = new KeywordLogger()

log.logInfo('PartnerXpath value from Excel data file is:  ' + partnerxpathval)

WebUI.click(clickPartner, FailureHandling.STOP\_ON\_FAILURE)