我想從下拉列表中選擇一個特定的值。正如我爲之前的下拉選擇所做的那樣,我也是這樣做的,但它不起作用。如何使用默認值和顏色,選項和激勵從下拉列表中選擇ID
頁面的鏈接是:
https://secure.bestprice.rankingsandreviews.com/nc/configurator/307715
我要選擇「轉換LT 1LT」的風格,「超金屬藍」顏色和任何選項和激勵機制,選擇
這裏是我的代碼:
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 => '$395').select
browser.li(:class => 'price update-incs').options(:text => '$1000').select
send_keys函數不能調用select_list,select不能調用p,它不能調用option對象(不適用於選項) – RAJ
我已經在下面寫了一個答案,你能檢查一下嗎? – RAJ