我正在做一些拖放js測試與硒客戶端。它的工作原理(在清楚地顯示要切換位置的元素之前和之後採取screengrabs),但我編程方式斷言發生的變化遇到麻煩。斷言css定位器等於它的預期值
上午我的心理,或者我不能做這樣的事情:
selenium.assert_equal("css locator", "expected id of element")
,在這種情況下,會看起來像:
selenium.assert_equal("css=li:nth-child(1)", "li#list_item_2")
上的任何提示如何實施這將是巨大的。
感謝,
亞當
編輯:如果我有selenium.get_element
,將採取選擇並返回它是什麼,然後我可以在下一步執行的斷言。
即
element = selenium.get_element("css=li:nth-child(1)")
assert_equal(element, "li#list_item_2")
(我想)。