Cov txheej txheem:

IReporter TestNG yog dab tsi?
IReporter TestNG yog dab tsi?

Video: IReporter TestNG yog dab tsi?

Video: IReporter TestNG yog dab tsi?
Video: Tus kab mob COVID-19 yog dab tsi? (What is COVID-19)? 2024, Kaum ib hlis
Anonim

TestNG tau muab lub peev xwm los siv ' IReporter ' ib qho kev sib txuas uas tuaj yeem siv los tsim cov ntawv tshaj tawm los ntawm cov neeg siv. Nws muaj 'generateReport()' txoj kev uas yuav raug hu tom qab tag nrho cov suite tau ua tiav nws qhov kev ua tiav thiab muab cov ntawv tshaj tawm rau hauv cov ntawv teev cov zis.

Ua raws li qhov no hauv kev txiav txim siab, siv TestNG mloog dab tsi?

Mloog yog txhais raws li interface uas hloov lub neej ntawd TestNG cov tus cwj pwm. Raws li lub npe qhia Cov neeg mloog "Mloog" rau qhov xwm txheej uas tau teev tseg hauv tsab ntawv selenium thiab coj tus cwj pwm kom haum. Nws yog siv hauv selenium los ntawm kev siv Cov neeg mloog Interface.

Ib yam li ntawd, peb tuaj yeem hloov kho TestNG cov ntawv ceeb toom? TestNG muaj inbuilt qhia muaj peev xwm nyob rau hauv nws. Tom qab ua tiav ntawm kev sim ntsuas, TestNG generates ib qho kev xeem-tso ntawv tais ceev tseg nyob rau hauv lub hauv paus ntawm qhov project. Rau customize TestNG qhia peb yuav tsum tau siv ob lub interfaces, ITestListener thiab IReporter. Yog peb xav tau ib qhia hauv nruab nrab ntawm kev ua haujlwm, peb xav tau ITestListener.

Ntawm no, kuv yuav siv TestNG reporter li cas?

TestNG Reporter Logs

  1. Sau cov ntaub ntawv xeem rau Daim Ntawv Thov Sau Npe thiab siv Log4j nkag rau txhua kauj ruam.
  2. Ntxig Reporter cav ntawm cov xwm txheej tseem ceeb ntawm qhov kev xeem.
  3. Khiav qhov kev xeem los ntawm txoj nyem rau ntawm cov ntawv xeem ntawv thiab xaiv Khiav Raws> TestNG Test.

Cov lus piav qhia hauv TestNG yog dab tsi?

Cov ntsiab lus ntawm TestNG Cov lus piav qhia @BeforeSuite: Lub sau tseg txoj kev yuav tau khiav ua ntej txhua qhov kev xeem hauv chav suite no tau khiav. @AfterSuite: Lub sau tseg txoj kev yuav tau khiav tom qab tag nrho cov kev xeem nyob rau hauv no suite tau khiav. @BeforeTest: Lub sau tseg txoj kev yuav tau khiav ua ntej ib qho kev xeem txoj kev teej tug mus rau cov chav kawm nyob rau hauv lub tag yog khiav.

Pom zoo: