Forum Discussion

Azeddin_Margani's avatar
Azeddin_Margani
Contributor
9 years ago

Select an item/link from dropdown list using passing variable..

Hi,   Can someone please assist. I'm trying to select an item from dropdown list using passing variables. The variables are  Link(0) and TextNode(0) which I'm trying to pass data from spreadsheet. ...
  • tristaanogre's avatar
    9 years ago

    What is in the value of DDT.CurrentDriver.Value("Sub Location")? 

    That is, possibly, the key to the problem.  The parameter passed to TextNode(0) probably has to be numeric. What you need to do is use a FindChild call of some sort on your component on the drop down that, after you click on the dropdown, you search the resulting component to find the text node you want based upon a text string you are passing in. Whatever object is returned on that FindChild call, execute the ClickMethod.

     

    So, your code should be something like:

    MyNode = Aliases.browser.pageMegariderTicketsForTheUk.panelPageWrapperPageWrapperTicke.panelWrapperWideWrapperBody.panelRowLocationUnknownHidden.form.panelLocationAutocompleteFieldRo.panelLocationSearchContainer.panelResults.FindChild("innerText", DDT.CurrentDriver.Value
    ("Sub Location"));
    
    MyNode.Click();

    This code is, obviously, not tested since I am not actually accessing your site.  The list of properties and their values will need to be determined by the actual components in question but that should give you the general idea of what to try.