Ask a Question

issue in selecting values from drop down

kavya_v
Occasional Contributor

issue in selecting values from drop down

I have to select values from dropdown iteratively and im using the following code.

I can get the full name of the dropdown item but storing the value in a varaible and using it doesnot work

 

Can any1 please tell where i went wrong.??

for i=0 to 1
Aliases.RCWinTrans9.wndRCWinTransX8Class.MDIClient.Acti_9_Smart_Test.Item.splitbuttonLanguages.dropdownbuttonOpen.Click

 

'To get the full name of dropdown item iteratively

name=NameMapping.Sys.RCWinTrans9.Item.GetUnderlyingObject.Child(i).FullName

 

'log full name of the child in the dropdown

'This is working absolutely fine

log.Message(name)

 

Aliases.RCWinTrans9.wndRCWinTransX8Class.MDIClient.Acti_9_Smart_Test.Item.splitbuttonLanguages.dropdownbuttonOpen.Click

 

/I am trying to click on the name ,but this throws runtime error

name.click

6 REPLIES 6
Marsha_R
Community Hero

What is the error message?


Marsha_R
[Community Hero]
____
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
kavya_v
Occasional Contributor

Throws RunTime error

If you look in the tab at the bottom of the test log, does it give details about the runtime error?


Marsha_R
[Community Hero]
____
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
leandroaraujoso
Contributor

Hi kavya_v,

 

The error is that you are trying to call the method "Click" in a variable that holds a string. 

 


/I am trying to click on the name ,but this throws runtime error

name.click

'name is just a string at this moment.

__________________________________________________________________________________

Try this:
Eval(name).Click()
Let me know if that helps.
Best regards,
Leandro de Araújo Souza

 



kavya_v
Occasional Contributor

Hi Leandro de Araújo Souza,

 

That worked for me.

 

Thanks a ton.

 

Regards,

kavya v

balathavamani
Occasional Contributor

Hi kavya,

 

For selecting values from dropdown list you can use this code ["ClickItem"]("Pass your Value here"); followed by Dropdown object name.

 

for Example:

 

var item= "values at Index1" ;

 

var Dropdown =Sys["Process"]("Sample")["Object"]("HwndSource: MainWindow",0)["ClickItem"](item);

 

Please try this & let me know.

 

Thanks

Balamurugan Thavamani

 

cancel
Showing results for 
Search instead for 
Did you mean: