をキャプチャ:セレンやFirefoxを使用して、私は他のものの間で取得する私のWebアプリ、私はオブジェクトをcaprtureするために使用することができると思うこのコードでリンクをマーキング対象物
cb_or_somename_someothername cb_area_0219
この文字列は、「クラス名」ですFirebugで
WebElement rolle = driver.findElement(By.className("cb_or_somename_someothername cb_area_0219"));
しかし、実行時にスクリプトが要素を見つけることができません: は私が入力したスクリプトに行きます。 Firebugのパネルでonfoその他
は次のとおりです。
class="cb_or_somename_someothername cb_area_0219"
onclick="jsf.util.chain(this,event,'$(this).attr(\'disabled\', \'disabled\');return true;','mojarra.jsfcljs(document.getElementById(\'fwMainContentForm\'),{\'fwMainContentForm:j_idt156:2:selectRole \':\'fwMainContentForm:j_idt156:2:selectRole\'},\'\')');return false"
href="#"
id="fwMainContentForm:j_idt156:2:selectRole"
は間違った方法で要素を参照する私のスクリプトですか?
複合クラス名については、「ElementNotFoundException」または例外がありますか? – Andersson
原因:org.openqa.selenium.InvalidSelectorException:指定されたセレクタcb_or_somename_someothername cb_area_0219が無効か、WebElementになりません。次のエラーが発生しました: InvalidSelectorError:複合クラス名は許可されていません このエラーに関する説明は、http://seleniumhq.org/exceptions/invalid_selector_exception.htmlを参照してください。 ビルドインフォメーション:バージョン: '2.53.1'、改訂: 'a36b8b1cd5757287168e54b817830adce9b0158d'、時刻: '2016-06-30 19:26:09' –