2012-05-14 5 views
0

C# 용 webdriver가 "nav_bottom"프레임을 찾지 못했습니다. "top"프레임을 인식 할 수 있습니다. 마크 업은 다음과 같습니다. id 또는 name 속성을 사용합니다.프레임이 인식되지 않습니다

<frameset> 
    <frame id ="top"> 
    <frameset id="bottom"> 
     <frame id="nav_bottom"> 

주어진 시간에 어떤 프레임이 표시되는지를 해결하여이 문제를 해결했습니다. 도와 줘서 고마워.

ReadOnlyCollection<IWebElement> frames1 = driver.FindElements(By.TagName("frame")); 

    Console.Write("total frames " + frames1.Count); 

    foreach (IWebElement frame in frames1) 
     { 
      Console.WriteLine("focus is on main frame " + frame.GetAttribute("id")); 
     } 
+0

현재 프레임을 어떻게 찾으려고합니까? 코드를 게시 하시겠습니까? – Nashibukasan

+0

// 메인 프레임으로 다시 집중 driver.SwitchTo(). DefaultContent(); wait.Until (x => x.FindElement (ByTagName ("frame").) 이름 ("ek_nav_bottom"))); driver.SwitchTo(). 프레임 ("ek_nav_bottom"); – RashmiPires

+0

그것은 (편집에서) 일을하는 더 안전한 방법처럼 보입니다. 나는 당신이 미리 결정된 이드에 의해 접근하려고 시도했을지도 모른다고 생각하고있었습니다. 듣기 좋다. 고침. – Nashibukasan

답변

0

드라이버를 먼저 설치해야합니다. 주위를 둘러 보면서 다음을 시도해보십시오.

driver.SwitchTo().Frame(the frame IWebElement); 

각 프레임을 IWebElement로 사용해보십시오. 도움이되기를 바랍니다.

+0

어떤 프레임이 표시되는지 문제를 해결하여이 문제를 해결할 수있었습니다. 프레임과 iframe이 여러 개 있습니다. – RashmiPires

관련 문제