如何使用默认值和颜色、选项和奖励从下拉列表中 select id
How to select id from dropdown with default value and color,options and incentives
我想 select 来自 dropdown.As 的特定值 我为之前的下拉菜单所做的 selection 与我为此所做的相同,但它不起作用。
页面的link是:
https://secure.bestprice.rankingsandreviews.com/nc/configurator/307715
我想 select "Convertible LT 1LT" 作为风格,"Hyper Metallic Blue" 作为颜色,任何选项和奖励都 selected
这是我的代码:
def test_price
browser.div(:id => 's2id_select_style').click
browser.select_list(:id => 'select_style').send_keys('Coupe LS')
browser.li(:class => 'exterior-color-swatch color-swatch').p(:text => 'Hyper Blue Metallic').select
browser.li(:class => 'price update-opts').options(:text => '5').select
browser.li(:class => 'price update-incs').options(:text => '00').select
试试这个,
browser.goto('https://secure.bestprice.rankingsandreviews.com/nc/configurator/307715')
browser.div(:id => 's2id_select_style').click
browser.element(xpath: ".//*[@id='select2-drop']/div/input").send_keys('Convertible LT 1LT',:tab)
browser.element(id: 'edit_color').click
browser.img(title: 'Hyper Blue Metallic').click
browser.span(text: 'Save & Update').click
我也不知道如何手动选择 14 和 1000(你的最后两行代码)所以我离开了。如果您告诉我如何手动选择,我也会包含相应的代码。但是让我知道上面的代码是否适合你!
我想 select 来自 dropdown.As 的特定值 我为之前的下拉菜单所做的 selection 与我为此所做的相同,但它不起作用。
页面的link是:
https://secure.bestprice.rankingsandreviews.com/nc/configurator/307715
我想 select "Convertible LT 1LT" 作为风格,"Hyper Metallic Blue" 作为颜色,任何选项和奖励都 selected
这是我的代码:
def test_price
browser.div(:id => 's2id_select_style').click
browser.select_list(:id => 'select_style').send_keys('Coupe LS')
browser.li(:class => 'exterior-color-swatch color-swatch').p(:text => 'Hyper Blue Metallic').select
browser.li(:class => 'price update-opts').options(:text => '5').select
browser.li(:class => 'price update-incs').options(:text => '00').select
试试这个,
browser.goto('https://secure.bestprice.rankingsandreviews.com/nc/configurator/307715')
browser.div(:id => 's2id_select_style').click
browser.element(xpath: ".//*[@id='select2-drop']/div/input").send_keys('Convertible LT 1LT',:tab)
browser.element(id: 'edit_color').click
browser.img(title: 'Hyper Blue Metallic').click
browser.span(text: 'Save & Update').click
我也不知道如何手动选择 14 和 1000(你的最后两行代码)所以我离开了。如果您告诉我如何手动选择,我也会包含相应的代码。但是让我知道上面的代码是否适合你!