2015-01-21 2 views

답변

3

는 XPath는에 의해 그것을 가져 오기 "에-연락처 선택"아리아 라벨에 의해 위치해야합니다

//span[@aria-label="To - Select Contacts"] 
0

또한 사용할 수 있습니다

//span[@data-tooltip = 'Select Contacts'] 
1

CSS 선택은이 XPath는 내 좋아하는 선택. ID를 사용하지 않고 요소를 찾기 위해 사용할 수있는 속성은 매우 다양합니다.

이 읽어 보시기 바랍니다 : 당신은 CSS 선택기를 사용할 수 있습니다 http://www.w3schools.com/cssref/css_selectors.asp

1

. Smth like this :

//If class name is permanent and there is single instance on the page 
driver.findElement(By.Css(".gO aQY")) 
//otherwise 
driver.findElement(By.Css("span[aria-label='To - Select Contacts']")) 

자세한 내용은 this 링크를 참조하십시오.

관련 문제