2017-11-14 11 views
0

これは、私が(データテーブル)テーブルから値を収集するために、Salesforceのアプリケーションたくされ機能していないテーブルのXPathは、下記の私はテーブルからQE値をこすりしたいHTMLコードSalesforceのアプリケーション -

<table class="slds-table forceRecordLayout slds-table--header-fixed slds-table--edit slds-table--bordered resizable-cols slds-table--resizable-cols uiVirtualDataTable" data-aura-rendered-by="519:0" data-aura-class="uiVirtualDataTable" style="width: 1256px;"> 
<thead data-aura-rendered-by="520:0"> 
<tfoot data-aura-rendered-by="523:0"></tfoot> 
<tbody data-aura-rendered-by="524:0"> 
<tr> 
<td class="slds-cell-edit slds-cell-edit slds-cell-error errorColumn cellContainer" tabindex="-1" data-aura-rendered-by="809:0"> 
<td class="slds-cell-edit cellContainer" tabindex="-1" data-aura-rendered-by="833:0"> 
<th class="slds-cell-edit cellContainer" scope="row" tabindex="-1" data-aura-class="forceInlineEditCell" data-aura-rendered-by="850:0"> 
<span class="slds-grid slds-grid--align-spread forceInlineEditCell" data-aura-rendered-by="866:0" data-aura-class="forceInlineEditCell"> 
<a class="slds-truncate outputLookupLink slds-truncate forceOutputLookup" data-refid="recordId" data-recordid="a2F46000000Y3s0EAC" 
data-special-link="true" href="#/sObject/a2F46000000Y3s0EAC/view" target="_blank" rel="noreferrer" title="QE" 
data-aura-rendered-by="860:0" data-aura-class="forceOutputLookup">QE</a> 
<span class="triggerContainer" data-aura-rendered-by="868:0"> 
</span> 
</th> 
</tr> 
</tbody> 
</table> 

ですそれは最初の行にあります。以下は

は私のXPathです:

driver.findElement(By.xpath("//table[@class='slds-table forceRecordLayout slds-table--header-fixed slds-table--edit slds-table--bordered\n" + 
" resizable-cols slds-table--resizable-cols uiVirtualDataTable']/tbody/tr/th/span")).getText(); 

このXPathをフレームにテーブルのクラス名を使用して、私はUnable to locate element

エラーの説明取得しています:

no such element: Unable to locate element: {"method":"xpath","selector":"//table[@class='slds-table forceRecordLayout slds-table--header-fixed slds-table--edit slds-table--bordered 
resizable-cols slds-table--resizable-cols uiVirtualDataTable']/tbody/tr/th/span"} 
    (Session info: chrome=61.0.3163.100) 
    (Driver info: chromedriver=2.29.461591 (62ebf098771772160f391d75e589dc567915b233),platform=Windows NT 6.1.7601 SP1 x86) (WARNING: The server did not provide any stacktrace information) 
Command duration or timeout: 300.01 seconds 

注:私は実行するとFirePathの私のxpath、その発見が正しく、しかし見つからない実行中に

+0

あなたは完全なエラースタックトレースとの質問を更新することはできますか? – DebanjanB

+0

@DebanjanB:私の質問に追加 – Prabu

答えて

0

あなたはリリースごとにchromedriver=2.29で作業しているようにchromedriver=2.29Supports Chrome v56-58をサポートしています注意します。我々はchrome=61.0で作業しているように、私たちは最小v2.32chromedriverバイナリをアップグレードする必要があります。

次に、あなたが次のコードブロックを使用することができ、テーブルからテキストQE値こすりする:

System.out.println(driver.findElement(By.xpath("//th[@class='slds-cell-edit cellContainer']/span/a[@class='slds-truncate outputLookupLink slds-truncate forceOutputLookup']")).getAttribute("innerHTML")); 
+0

クロムドライバについての情報をありがとうが、同じ例外が発生したテキストスクレープ要素を見つけることができませんでした。 – Prabu

関連する問題