2014-11-27 3 views
0

이 시나리오에서는 자동화 테스트를 수행 할 것입니다. 버튼에 마우스를 올려 놓으면 플로트 메뉴가 나타납니다. 그리고 float 메뉴에서 로고를 확인하고 싶습니다. 내가이 명령을 시도robotframeworks + selenium2libarary와 함께 마우스를 놓고 요소를 확인하는 방법

<div class="header float-header"> 
    <div class="logo float-header"> 
    ... 

:

mouse over | css=div.header-status-btn[title="Restore the header"] 

page should contain element | css=div.logo.float-header 

을하지만이 기본적으로 , 그것이 :에

<div class="header fold"> 
    <div class="logo fold"> 
    ... 

가있을 때 버튼에 마우스를 올려 페이지가 켜집니다 항상 오류 :

FAIL : ValueError: Element locator 'css=div.logo.float-header' did not match any elements.

이렇게하면 플로팅 메뉴에서 요소를 찾을 수 없습니다. 누구든지 마우스로 플로트 메뉴를 확인하는 방법을 알고 있습니까?

+0

당신이 XPath는에 의해 위치를 시도? 버튼의 HTML이 누락되었지만 다음과 같이 작동 할 수 있습니다. '마우스 오버 | // header-status-btn [@ title = '헤더 복원'] 페이지를 포함 할 때까지 대기 요소 | // div [@ class = 'logo float-header'] ' –

+0

시도했지만 "페이지에 요소가 포함될 때까지 대기"가 작동하지 않습니다. 메뉴가 펼쳐지기 전에 플로트 헤더가 있지만 숨김 모드에 있기 때문입니다. float-header가 아직 표시되지 않더라도 항상 성공합니다. – cyllouis

+0

어떨까요 'Wait Until Element Visible | // div [@ class = 'logo float-header']' –

답변

0

이 시도 :

Mouse Over | css=div.header-status-btn[title="Restore the header"] 
# wait up to 60s for element to become visible 
Set Selenium Implicit Wait | 60 
Wait Until Element Is Visible | css=div.logo.float-header 
관련 문제