2016-06-29 8 views
0

Ich teste eine gwt Webapp. Während ich meinen Selentest so dynamisch wie möglich mache, bin ich gegen eine Wand gelaufen. Das Element kommt von einer Seite, die ein Popup hat, das auch ein Popup mit einem Dropdown hat, das das Element enthält. Das Problem ist, dass das Element nicht sichtbar ist, so dass ich nicht auf das Element klicken kann.Selen Scroll Elemente in Sicht

Nicht der Körper der Seite

Ich muss Blättern Der Versuch, das Element in die Ansicht scrollen, während einige, wie diese von XPath finden Element enthält: driver.findElement(By.xpath("//*[contains(text(), 'NO')]")).an_action();

„enthält“ ist mit einer sehr wichtig, um diesen Test dynamisch zu machen.

Hier ist der HTML-Code des Teils Kontrolle Ich versuche:

<div id="x-auto-908" class="x-combo-list x-ignore x-component x-border " role="presentation" style="border-width: 1px; z-index: 1565; visibility: visible; height: 298px; width: 104px; left: 670px; top: 94px;"> 
 
<div id="x-auto-740" class=" x-view x-combo-list-inner x-component x-unselectable" tabindex="0" hidefocus="true" style="overflow-x: hidden; padding: 0px; border-width: 0px; height: 298px; width: 104px;" unselectable="on"> 
 
<div class="x-combo-list-item " role="listitem">--</div> 
 
<div class="x-combo-list-item" role="listitem">AL</div> 
 
<div class="x-combo-list-item " role="listitem">AR</div> 
 
<div class="x-combo-list-item" role="listitem">CO</div> 
 
<div class="x-combo-list-item" role="listitem">FL</div> 
 
<div class="x-combo-list-item " role="listitem">FL</div> 
 
<div class="x-combo-list-item " role="listitem">GA</div> 
 
<div class="x-combo-list-item " role="listitem">HH</div> 
 
<div class="x-combo-list-item" role="listitem">IA</div> 
 
<div class="x-combo-list-item " role="listitem">ID</div> 
 
<div class="x-combo-list-item " role="listitem">IL</div> 
 
<div class="x-combo-list-item " role="listitem">IN</div> 
 
<div class="x-combo-list-item x-view-highlightrow x-combo-selected" role="listitem">KK</div> 
 
<div class="x-combo-list-item" role="listitem">KS</div> 
 
<div class="x-combo-list-item" role="listitem">LA</div> 
 
<div class="x-combo-list-item" role="listitem">LL</div> 
 
<div class="x-combo-list-item" role="listitem">MI</div> 
 
<div class="x-combo-list-item" role="listitem">MM</div> 
 
<div class="x-combo-list-item" role="listitem">MN</div> 
 
<div class="x-combo-list-item" role="listitem">MO</div> 
 
<div class="x-combo-list-item" role="listitem">MS</div> 
 
<div class="x-combo-list-item" role="listitem">MT</div> 
 
<div class="x-combo-list-item" role="listitem">NC</div> 
 
<div class="x-combo-list-item" role="listitem">NE</div> 
 
<div class="x-combo-list-item" role="listitem">NJ</div> 
 
<div class="x-combo-list-item" role="listitem">NM</div> 
 
<div class="x-combo-list-item" role="listitem">NO</div> 
 
<div class="x-combo-list-item" role="listitem">NV</div> 
 
<div class="x-combo-list-item " role="listitem">OH</div> 
 
<div class="x-combo-list-item" role="listitem">OK</div> 
 
<div class="x-combo-list-item" role="listitem">OR</div> 
 
<div class="x-combo-list-item" role="listitem">PA</div> 
 
<div class="x-combo-list-item" role="listitem">SC</div> 
 
<div class="x-combo-list-item" role="listitem">TN</div> 
 
<div class="x-combo-list-item" role="listitem">TX</div> 
 
<div class="x-combo-list-item" role="listitem">VA</div> 
 
<div class="x-combo-list-item" role="listitem">WA</div> 
 
<div class="x-combo-list-item" role="listitem">WI</div> 
 
<div class="x-combo-list-item" role="listitem">WW</div> 
 
<div class="x-combo-list-item" role="listitem">WY</div> 
 
<div class="x-combo-list-item" role="listitem">ZZ</div> 
 
</div>

Ich glaube, das Problem ist gwt iframe.

Antwort

0

Verwenden Action-Klasse:

Actions actions = new Actions(getDriver()); 
actions.moveToElement(webElement); 
+0

hat es nicht funktioniert. Ich glaube, es hat etwas damit zu tun, wie gwt Dinge macht. Es funktioniert auf anderen Anwendungen nur nicht gwt Anwendungen. – Amd046

Verwandte Themen