Thaum twg siv nosuchelementexception?

Cov txheej txheem:

Thaum twg siv nosuchelementexception?
Thaum twg siv nosuchelementexception?
Anonim

Raws li lub npe qhia, NoSuchElementException raug pov thaum sim nkag mus rau qhov tsis raug siv siv ob peb txoj hauv kev los ntawm cov chav kawm Enumeration thiab Iterator.

Vim li cas peb thiaj tau NoSuchElementException?

NoSuchElementException hauv Java yog pov thaum ib tus sim nkag mus rau qhov tsis tau tshaj nws qhov kev txwv siab tshaj. Qhov kev zam qhia tau hais tias tsis muaj cov ntsiab lus ntxiv ntxiv kom rov hais dua hauv kev suav sau.

NoSuchElementException selenium yog dab tsi?

NoSuchElementException yog ib qho ntawm qhov sib txawv ntawm WebDriver Exceptions thiab qhov kev zam no tshwm sim, thaum cov chaw nyob (piv txwv li id / xpath / css selectors thiab lwm yam) peb tau hais hauv Selenium Program code nrhiav tsis tau lub vev xaib ntawm nplooj ntawv web.

Koj ua li cas nrog NoSuchElementException?

YUAV KOM NOSUCHELEMENT EXCEPTION IN JAVA SELENIUM

  1. Qhib chrome browser.
  2. Nkag mus rau qhov URL ntawm
  3. Sau tus lej rau Nyem rau ntawm tus lej nkag.
  4. tsav tsheb. findElement(By. xpath("//div[.='Login']")). nias;
  5. Nws cuam NoSuchElementException li Xpath qhia tias koj tau theej tsis raug.

Yuav ua li cas cov txheej txheem twg tuaj yeem cuam tshuam NoSuchElementException?

next" txoj hauv kev yuav tsum pov "NoSuchElementException" Los ntawm daim ntawv cog lus, txhua qhov kev siv ntawm java.

Pom zoo: