How to select a Suggested value from drop down box

前端 未结 1 1108
滥情空心
滥情空心 2021-01-28 15:16

On the Virgintrains.co.uk website trying to select a arrival train station

In my Code I am able to select the departure location and in the next field I would like to se

相关标签:
1条回答
  • 2021-01-28 16:04

    You are trying to send a Tab press to null elements. Instead of separating the location and the tab key press, put them on the same line:

    textBoxDep.sendKeys("London Euston" + Keys.TAB);
    
    textBoxArr.sendKeys("Manchester Piccadilly" + Keys.TAB + Keys.TAB);
    

    Also, Thread.sleep is not suggested. You can use a wait for a specific condition before proceeding instead. More info on waits here: https://www.toolsqa.com/selenium-webdriver/wait-commands/

    0 讨论(0)
提交回复
热议问题