"경도"과의 첫 번째 요소를 클릭 한 다음 드롭 다운이 트리거 될 때까지 기다리고 명부.
"lon"으로 작성하면 "London, England, Storbritannia", 런던, 켄터키, 미국 등 많은 옵션이 표시됩니다. watir을 사용하면 어떻게 될까요? thnx에 미리 있습니다.
이것은 내 코드가 지금까지 보이는 것입니다. odes가 작동하지 않으며 어디에서 무엇을 놓쳤는 지 궁금합니다. from_field = @ site.ie.text_field (비행 :, 여행)
데프 site.navigate_to @ 을 test_scriptflight_autocomplete (: ID, "locOriginName") to_field = @ site.ie.text_field (: 아이디, 'locDestinationName ') from_field.set ('오슬로 ')
# need to fire a key press event after setting the text since the js is handling
# trigger the autocomplete (requires a 'keydown')
from_field.fire_event('onkeydown')
# wait until the autocomplete gets populated with the AJAX call
@site.ie.wait_until{@site.ie.div(:id, 'onlinesearch').lis.length > 0}
puts @site.ie.div(:id, 'locOriginName ').lis.length
puts @site.ie.div(:id, 'locOriginName').li(:index, 5).text
# find the li you want to select in the autocomplete list and click it
@site.ie.div(:id, 'from-field').li(:text, 'Oslo, Oslo, Norge').click
끝