Cov txheej txheem:

Kuv yuav qhib selenium hauv Chrome li cas?
Kuv yuav qhib selenium hauv Chrome li cas?

Video: Kuv yuav qhib selenium hauv Chrome li cas?

Video: Kuv yuav qhib selenium hauv Chrome li cas?
Video: Niam Vam xab poob teb chaws. 10/1612017 2024, Kaum ib hlis
Anonim
  1. import org. qhib. selenium . WebDriver ;
  2. import org. qhib. selenium . chrome .
  3. pej xeem chav TestChrome {
  4. public static void main(String args) {
  5. Qhov system. setProperty(" webdriver . chrome .driver", "path of the exe file\chromedriver.exe");
  6. // Pib qhov browser.
  7. WebDriver driver=new ChromeDriver();
  8. // Qhib facebook.

Yog li ntawd, kuv yuav qhib qhov browser tshiab hauv selenium li cas?

Siv ib qho webdriver rau qhib ntau browser qhov rai.

  1. Nrhiav html lub cev lub vev xaib.
  2. Xa "Ctrl + t" hais kom ua rau lub cev lub ntsiab kom qhib tab tshiab.
  3. Xa "Ctrl + 2" mus rau qhov thib ob.
  4. Hloov qhov url rau google.com rau qhov thib ob.
  5. Tau txais lub cev lub vev xaib hauv lub tab thib ob.
  6. Xa "Ctrl + 3" mus rau qhov thib peb.

Tsis tas li ntawd, kuv yuav nruab selenium li cas? Yuav Ua Li Cas Download & Nruab Selenium WebDriver

  1. Kauj ruam 1 - Nruab Java ntawm koj lub computer. Download tau thiab nruab Java Software Development Kit (JDK) ntawm no.
  2. Kauj ruam 2 - Nruab Eclipse IDE. Download tau qhov tseeb version ntawm "Eclipse IDE rau Java Developers" ntawm no.
  3. Kauj ruam 3 - Rub tawm Selenium Java Client Driver.
  4. Kauj ruam 4 - Configure Eclipse IDE nrog WebDriver.

Ntawm no, kuv yuav siv Chrome tsav tsheb li cas?

Txoj Kev 1: Siv webdriver. chrome. driver system khoom

  1. Luam tag nrho txoj kev uas koj unzipped chromedriver.exe. Cia peb xav tias qhov chaw yog - D:Driverschromedriver.exe.
  2. Code tso tawm Chrome browser yuav zoo li no -
  3. Khiav cov cai no kom paub tseeb tias nws ua haujlwm zoo.

ChromeDriver yog dab tsi?

ChromeDriver yog ib qho executable uas Selenium WebDriver siv los tswj Chrome . Nws yog tswj hwm los ntawm pab pawg Chromium nrog kev pab los ntawm WebDriver contributors. Yog tias koj tsis paub nrog Selenium WebDriver, koj yuav tsum mus xyuas Selenium site.

Pom zoo: