2016-05-09 7 views
0

IBM BPMポータルでは、リスト・ボックスの横に次のドロップダウン矢印があり、DOM構造内にリスト項目を表示するにはクリックが必要です。IBM BPMリスト・ボックスのドロップダウン・イメージをクリックできません

<div class="dijitReset dijitRight dijitButtonNode dijitArrowButton dijitDownArrowButton dijitArrowButtonContainer dijitDownArrowButtonHover" role="presentation" data-dojo-attach-point="_buttonNode, _popupStateNode"> 
 
<input class="dijitReset dijitInputField dijitArrowButtonInner" type="image" role="presentation" readonly="readonly" tabindex="-1" alt="" src="/teamworks/script/coachNG/dojo/1.8.6/dojo/resources/blank.gif"/>

画像: enter image description here

手動で画像をクリックすると、リスト項目を次のようが表示されます。

<div id="dijit_form_FilteringSelect_1_popup_prev" class="dijitMenuItem dijitMenuPreviousButton" role="option" data-dojo-attach-point="previousButton" style="display: none;">Previous choices</div> 
 
<div id="dijit_form_FilteringSelect_1_popup0" class="dijitReset dijitMenuItem" role="option" item="0">--- Select ---</div> 
 
<div id="dijit_form_FilteringSelect_1_popup1" class="dijitReset dijitMenuItem" role="option" item="1">CJA Coversheet</div> 
 
<div id="dijit_form_FilteringSelect_1_popup2" class="dijitReset dijitMenuItem" role="option" item="2">Correspondence</div> 
 
<div id="dijit_form_FilteringSelect_1_popup3" class="dijitReset dijitMenuItem" role="option" item="3">Proof of Address</div> 
 
<div id="dijit_form_FilteringSelect_1_popup4" class="dijitReset dijitMenuItem" role="option" item="4">Proof of Identity</div> 
 
<div id="dijit_form_FilteringSelect_1_popup_next" class="dijitMenuItem dijitMenuNextButton" role="option" data-dojo-attach-point="nextButton" style="display: none;">More choices</div>

私は、ドロップダウンリストに次の画像をクリックして次のオプションを試してみました。

コード1: int xOffset = 0、yOffset = 0; アクションactions = newアクション(ドライバ);
WebElement TreeObj = driver.findElement(By.xpath( "// * [@ id = 'widget_dijit_form_FilteringSelect_1'] /子孫::入力[@タイプ= 'イメージ']」)); actions.moveToElement(TreeObj、xOffset、yOffset);
actions.moveToElement(TreeObj).click()。build()。perform();

CODE2: driver.findElement(By.xpath( "// * [@ ID = 'widget_dijit_form_FilteringSelect_1'] /子孫::入力[@ TYPE = '画像']")))(クリック;。

CODE3:
driver.findElement(By.xpath( "(//入力[タイプ@ = '画像'])2")))(クリック;。

他の人に、リストボックスから項目を選択するためにオブジェクトをクリックして調べるように依頼してください。

答えて

0

通常のアクションクラスまたはクリック方法では、ドロップダウンを処理できません。 選択クラスを使用する必要があります。

だから、ドロップダウンから値を選択することも、他の方法があり、この..

Webelement someobject = driver.findElement(By.xpath("//*[@id='widget_dijit_form_FilteringSelect_1']/descendant::input[@type='image']")); 

Select select = new Select(someobject); 

someobject.selectByVisibleText("CJA Coversheet"); 

を試して、私はこれを実行しようとするあなたの目に見えるテキストの方法.. を示しています。それがあなたを助けることを願って..

このリンクを介して行ってください。それが走っているか否か返信ください。..

https://www.seleniumeasy.com/selenium-tutorials/webdriver-select-methods-to-work-with-dropdowns

非常に便利です。 ハッピーラーニング :-)

+0

//私は、リストの項目を確認するには、次のオプションを試してみましたが、無駄WebElementドロップダウン= driver.findElement(By.xpath( "// * [ID @ = 'widget_dijit_form_FilteringSelect_1']でいます/ descendant :: input [@ type = 'image'] ")); \t Select select = new Select(ドロップダウン); リスト options = select.getOptions(); (WebElement EachObj:options) の場合 {for(int i = 0; i

+0

コードを共有してください。 –

0

最後に、BPMリストボックスでアクションを実行するソリューションを見つけることができました。あなたの提案は、他のWebオブジェクトでは役に立ちますが、BPMのリストボックスでは役に立ちません。

String parameter = "--- Select ---;CJA Coversheet;Correspondence;Proof of Address;Proof of Identity"; 
 
      String[] splitparameter= parameter.split(";"); \t 
 
      
 
      WebElement fr = driver.findElement(By.xpath("//iframe[@dojoattachpoint='frame']")); 
 
      driver.switchTo().frame(fr); 
 
      
 
      //driver.findElement(By.xpath("(//input[@type='image'])[1]")).click(); 
 
      Thread.sleep(2000); 
 
      
 
      driver.findElement(By.xpath("//*[@id='dijit_form_FilteringSelect_0']")).clear(); 
 
      driver.findElement(By.xpath("//*[@id='dijit_form_FilteringSelect_0']")).sendKeys("CJA"); 
 
      
 
      driver.findElement(By.xpath("//*[@id='widget_dijit_form_FilteringSelect_1']/descendant::input[@type='image']")).click();   
 
      driver.findElement(By.xpath("//*[@id='dijit_form_FilteringSelect_1']")).clear();  
 
           
 
      WebElement TreeObj=driver.findElement(By.xpath("//*[@id='widget_dijit_form_FilteringSelect_1']/descendant::input[@type='image']")); 
 
\t \t //.................................................................................................................. \t \t  
 
\t \t int xOffset = 2, yOffset = 2; 
 
\t \t Actions actions = new Actions(driver); \t  
 
\t \t \t actions.moveToElement(TreeObj, xOffset, yOffset).click().build().perform(); 
 
\t \t Thread.sleep(2000); 
 
\t \t List<WebElement> allListOptions = driver.findElements(By.xpath("//div[contains(@id,'FilteringSelect_1')]/descendant::div[contains(@id,'FilteringSelect') and @role='option' and @item>='0']")); 
 

 
//allListOptions.get(0).getText() 
 
\t \t for (int i = 0; i < splitparameter.length; i++) { \t \t  
 
\t \t \t String optionValue = allListOptions.get(i).getText(); 
 
\t \t  if (optionValue.equals(splitparameter[i])) { \t \t \t \t   
 
\t \t   
 
\t \t  \t System.out.println("Value verified with the expected value: "+ optionValue); 
 
\t \t  } else { \t \t \t \t   
 
\t \t   
 
\t \t  \t System.out.println("Failed to verify value with the expected value: "+ optionValue); 
 
\t \t  } 
 
\t \t } \t

関連する問題