html - Ruby- Selenium: Could we find an element by its 2 properties in parallel at the same time? -
first of all, have element that:
"<"id="select_a_boundary" class="dataset_select2">homes name<>
as know, when find element selenium in ruby based on property use method:
@driver.find_element(:id, "select_a_boundary") or @driver.find_element(class,"dataset_select2")
could know way find element both properties id , class in selenium ruby? because there other element has same id property or same class property. and assume not allowed use xpath combine it, how deal it? suggestion.
<div id="select_a_boundary" class="dataset_select2">homes name</div>
selenium code:
@driver.find_element(:xpath, "//div[@id = 'select_a_boundary' , @class = 'dataset_select2']") @driver.find_element(:css, "div[id=select_a_boundary][class=dataset_select2]") @driver.find_element(:css, "#select_a_boundary.dataset_select2")
Comments
Post a Comment