error :รันโค้ด selenium test mooziicart
Moderator: mindphp, ผู้ดูแลกระดาน
- chakirin.bfds
- PHP Super Hero Member
- โพสต์: 783
- ลงทะเบียนเมื่อ: 22/12/2020 10:19 am
error :รันโค้ด selenium test mooziicart
รันโค้ด selenium สำหรับ ทดสอบ MooZiiCart ผ่าน command เเล้วเกิด error ตามภาพนี้ครับ
ไม่ทราบว่าผิดพลาดอะไร ต้องแก้ไขตรงไหน ช่วยไกด์ให้หน่อยครับ
- mindphp
- ผู้ดูแลระบบ MindPHP
- โพสต์: 41344
- ลงทะเบียนเมื่อ: 22/09/2008 6:18 pm
- ติดต่อ:
Re: error :รันโค้ด selenium test mooziicart
ขอ ข้อความ Error ด้วยครับ
เว็บบอร์ด จะช่วยไกด์ กระทู้เก่าๆ ให้
เว็บบอร์ด จะช่วยไกด์ กระทู้เก่าๆ ให้
ติดตาม VDO: http://www.youtube.com/c/MindphpVideoman
ติดตาม FB: https://www.facebook.com/pages/MindphpC ... 9517401606
หมวดแชร์ความรู้: https://www.mindphp.com/forums/viewforum.php?f=29
รับอบรม และพัฒนาระบบ: https://www.mindphp.com/forums/viewtopic.php?f=6&t=2042
ติดตาม FB: https://www.facebook.com/pages/MindphpC ... 9517401606
หมวดแชร์ความรู้: https://www.mindphp.com/forums/viewforum.php?f=29
รับอบรม และพัฒนาระบบ: https://www.mindphp.com/forums/viewtopic.php?f=6&t=2042
- chakirin.bfds
- PHP Super Hero Member
- โพสต์: 783
- ลงทะเบียนเมื่อ: 22/12/2020 10:19 am
Re: error :รันโค้ด selenium test mooziicart
ข้อความ error code ครับ
line 76 line 947 line 1551 line 315 line 164
line 76 line 947 line 1551 line 315 line 164
แก้ไขล่าสุดโดย chakirin.bfds เมื่อ 29/12/2020 2:33 pm, แก้ไขไปแล้ว 1 ครั้ง.
- mindphp
- ผู้ดูแลระบบ MindPHP
- โพสต์: 41344
- ลงทะเบียนเมื่อ: 22/09/2008 6:18 pm
- ติดต่อ:
Re: error :รันโค้ด selenium test mooziicart
ขอ เป็นข้อความมาแปะ กระทู้เลยครับ และ ปิดข้อความ ส่วนตัว เช่น user, email, password ออก ด้วยครับ
โค้ดไม่ต้อง cap ภาพมาแปะ
*** copy code
*** ข้อความ Error มาแปะ ในบอร์ด
โค้ดไม่ต้อง cap ภาพมาแปะ
*** copy code
*** ข้อความ Error มาแปะ ในบอร์ด
ติดตาม VDO: http://www.youtube.com/c/MindphpVideoman
ติดตาม FB: https://www.facebook.com/pages/MindphpC ... 9517401606
หมวดแชร์ความรู้: https://www.mindphp.com/forums/viewforum.php?f=29
รับอบรม และพัฒนาระบบ: https://www.mindphp.com/forums/viewtopic.php?f=6&t=2042
ติดตาม FB: https://www.facebook.com/pages/MindphpC ... 9517401606
หมวดแชร์ความรู้: https://www.mindphp.com/forums/viewforum.php?f=29
รับอบรม และพัฒนาระบบ: https://www.mindphp.com/forums/viewtopic.php?f=6&t=2042
- chakirin.bfds
- PHP Super Hero Member
- โพสต์: 783
- ลงทะเบียนเมื่อ: 22/12/2020 10:19 am
Re: error :รันโค้ด selenium test mooziicart
โค้ดที่ผมคิดว่าจะมีปัญหาคือ
Error line 76
Error line 947
Error line 1551
Error line 315
Error line 164
Error line 83
error ที่เเจ้งเตือน
Error line 76
โค้ด: เลือกทั้งหมด
'Orders'
value_order = 2
status_order = 'Cancelled' #Cancelled , Paid
Error line 947
โค้ด: เลือกทั้งหมด
for i in range(10):
try:
if self.driver.find_element_by_css_selector('.row0:nth-child(%d) > td:nth-child(%d) > a' % ( n, td)):
ojb = self.driver.find_element_by_css_selector('.row0:nth-child(%d) > td:nth-child(%d) > a' % (n, td))
msg = ojb.text
self.msg1 = msg # .row0:nth-child(3) > td:nth-child(3) > a
break
except:
pass
print(i)
time.sleep(1)
Error line 1551
โค้ด: เลือกทั้งหมด
for i in range(4):
try:
if self.driver.find_element_by_link_text("Description (en)"):
self.report_error()
except:
pass
else:
print('check pass1')
for i in range(4):
try:
if self.driver.find_element_by_link_text("Description (th)"):
self.report_error()
except:
pass
else:
print('check pass2')
self.find_css(Cancel)
โค้ด: เลือกทั้งหมด
def setUp(self):
self.driver = webdriver.Firefox(executable_path=path) # __builtin__.firefoxpath)
self.base_url = wed0 # __builtin__.base_url #=
self.base_url1 = wed1 # __builtin__.base_url1 #=
self.username = user # __builtin__.username #=
self.username1 = user1 # __builtin__.username1 #=
self.username2 = user2 # __builtin__.username1 #=
self.pwd = password # __builtin__.pwd #=
self.pwd1 = password1 # __builtin__.pwd1 #=
self.pwd2 = password2 # __builtin__.pwd1 #=
self.verificationErrors = []
self.accept_next_alert = True
self.wait = WebDriverWait(self.driver, 10)
self.Case = Case
โค้ด: เลือกทั้งหมด
'Delivery time'
Title_en = 'test003'
Title_en1 = 'test033'
Title_th = 'test003'
Days = '30'
Days1 = '15'
Delivery_timefile_edit = 'test003'
โค้ด: เลือกทั้งหมด
'Clients'
ClientsUsername = '000000'
ClientsUsername1 = '000000'
ClientsEmail = '[email protected]'
ClientsEmail1 = '[email protected]'
ClientsPassword = '000000'
ClientsPassword1 = '000000'
ClientsUsergroup = '0000'
Clientsfile_edit = '00000'
error ที่เเจ้งเตือน
โค้ด: เลือกทั้งหมด
/home/com003/PycharmProjects/pythonProject1/venv/bin/python /home/com003/Downloads/r-selenium-test-mooziicart-master/selenium_moozii_T2.py
E
======================================================================
ERROR: test00 (__main__.test01_check)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/com003/PycharmProjects/pythonProject1/venv/lib/python3.5/site-packages/selenium/webdriver/common/service.py", line 76, in start
stdin=PIPE)
File "/usr/lib/python3.5/subprocess.py", line 947, in __init__
restore_signals, start_new_session)
File "/usr/lib/python3.5/subprocess.py", line 1551, in _execute_child
raise child_exception_type(errno_num, err_msg)
FileNotFoundError: [Errno 2] No such file or directory: 'geckodriver.exe'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/com003/Downloads/r-selenium-test-mooziicart-master/selenium_moozii_T2.py", line 315, in setUp
self.driver = webdriver.Firefox(executable_path=path) # __builtin__.firefoxpath)
File "/home/com003/PycharmProjects/pythonProject1/venv/lib/python3.5/site-packages/selenium/webdriver/firefox/webdriver.py", line 164, in __init__
self.service.start()
File "/home/com003/PycharmProjects/pythonProject1/venv/lib/python3.5/site-packages/selenium/webdriver/common/service.py", line 83, in start
os.path.basename(self.path), self.start_error_message)
selenium.common.exceptions.WebDriverException: Message: 'geckodriver.exe' executable needs to be in PATH.
----------------------------------------------------------------------
Ran 1 test in 0.008s
FAILED (errors=1)
Process finished with exit code 1
- mindphp
- ผู้ดูแลระบบ MindPHP
- โพสต์: 41344
- ลงทะเบียนเมื่อ: 22/09/2008 6:18 pm
- ติดต่อ:
Re: error :รันโค้ด selenium test mooziicart
จากที่ Error นี้
ในเครื่องเรา ไม่มี geckodriver.exe
ถ้าใช้ Ubuntu กำหนด path นี้ใหม่ โดยโหลด geckodriver จากที่นี่
https://github.com/mozilla/geckodriver/releases
แล้วแก้ไข โค้ดส่วนที่เรียก หาไฟล์ geckodriver.exe เป็นไฟล์ geckodriver ตัวใหม่สำหรับ Ubuntu ที่โหลดมา
ระบบ แจ้งว่า WebDriverException/home/com003/PycharmProjects/pythonProject1/venv/bin/python /home/com003/Downloads/r-selenium-test-mooziicart-master/selenium_moozii_T2.py
E
======================================================================
ERROR: test00 (__main__.test01_check)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/com003/PycharmProjects/pythonProject1/venv/lib/python3.5/site-packages/selenium/webdriver/common/service.py", line 76, in start
stdin=PIPE)
File "/usr/lib/python3.5/subprocess.py", line 947, in __init__
restore_signals, start_new_session)
File "/usr/lib/python3.5/subprocess.py", line 1551, in _execute_child
raise child_exception_type(errno_num, err_msg)
FileNotFoundError: [Errno 2] No such file or directory: 'geckodriver.exe'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/com003/Downloads/r-selenium-test-mooziicart-master/selenium_moozii_T2.py", line 315, in setUp
self.driver = webdriver.Firefox(executable_path=path) # __builtin__.firefoxpath)
File "/home/com003/PycharmProjects/pythonProject1/venv/lib/python3.5/site-packages/selenium/webdriver/firefox/webdriver.py", line 164, in __init__
self.service.start()
File "/home/com003/PycharmProjects/pythonProject1/venv/lib/python3.5/site-packages/selenium/webdriver/common/service.py", line 83, in start
os.path.basename(self.path), self.start_error_message)
selenium.common.exceptions.WebDriverException: Message: 'geckodriver.exe' executable needs to be in PATH.
----------------------------------------------------------------------
Ran 1 test in 0.008s
FAILED (errors=1)
Process finished with exit code 1
ในเครื่องเรา ไม่มี geckodriver.exe
ถ้าใช้ Ubuntu กำหนด path นี้ใหม่ โดยโหลด geckodriver จากที่นี่
https://github.com/mozilla/geckodriver/releases
แล้วแก้ไข โค้ดส่วนที่เรียก หาไฟล์ geckodriver.exe เป็นไฟล์ geckodriver ตัวใหม่สำหรับ Ubuntu ที่โหลดมา
ติดตาม VDO: http://www.youtube.com/c/MindphpVideoman
ติดตาม FB: https://www.facebook.com/pages/MindphpC ... 9517401606
หมวดแชร์ความรู้: https://www.mindphp.com/forums/viewforum.php?f=29
รับอบรม และพัฒนาระบบ: https://www.mindphp.com/forums/viewtopic.php?f=6&t=2042
ติดตาม FB: https://www.facebook.com/pages/MindphpC ... 9517401606
หมวดแชร์ความรู้: https://www.mindphp.com/forums/viewforum.php?f=29
รับอบรม และพัฒนาระบบ: https://www.mindphp.com/forums/viewtopic.php?f=6&t=2042
- mindphp
- ผู้ดูแลระบบ MindPHP
- โพสต์: 41344
- ลงทะเบียนเมื่อ: 22/09/2008 6:18 pm
- ติดต่อ:
Re: error :รันโค้ด selenium test mooziicart
ปัญหา เดียวกับกระทู้นี้
viewtopic.php?f=298&t=69900&p=198529
viewtopic.php?f=298&t=69900&p=198529
ติดตาม VDO: http://www.youtube.com/c/MindphpVideoman
ติดตาม FB: https://www.facebook.com/pages/MindphpC ... 9517401606
หมวดแชร์ความรู้: https://www.mindphp.com/forums/viewforum.php?f=29
รับอบรม และพัฒนาระบบ: https://www.mindphp.com/forums/viewtopic.php?f=6&t=2042
ติดตาม FB: https://www.facebook.com/pages/MindphpC ... 9517401606
หมวดแชร์ความรู้: https://www.mindphp.com/forums/viewforum.php?f=29
รับอบรม และพัฒนาระบบ: https://www.mindphp.com/forums/viewtopic.php?f=6&t=2042
- chakirin.bfds
- PHP Super Hero Member
- โพสต์: 783
- ลงทะเบียนเมื่อ: 22/12/2020 10:19 am
Re: error :รันโค้ด selenium test mooziicart
เรียบร้อยเเล้วครับ
-
- Similar Topics
- ตอบกลับ
- แสดง
- โพสต์ล่าสุด
-
-
โพสต์ใหม่ เขียน if ใน selenium test แล้วเกิด Error จะต้องทำอย่างไรบ้างครับ
โดย บัวบุญ จันทะโคตร » 01/08/2017 5:34 pm » ใน Programming - C/C++ & java & Python - 0 ตอบกลับ
- 613 แสดง
-
โพสต์ล่าสุด โดย บัวบุญ จันทะโคตร
01/08/2017 5:34 pm
-
-
-
โพสต์ใหม่ Test ระบบด้วย Selenium IDE แล้วอ่านค่าlogไม่เป็น
โดย M030 » 16/09/2015 3:14 pm » ใน Programming - PHP - 3 ตอบกลับ
- 798 แสดง
-
โพสต์ล่าสุด โดย m028
16/09/2015 4:37 pm
-
-
-
โพสต์ใหม่ คำถามเกี่ยวกับงาน selenium test เว็บบอร์ด
โดย บัวบุญ จันทะโคตร » 09/08/2017 8:49 pm » ใน Programming - C/C++ & java & Python - 2 ตอบกลับ
- 694 แสดง
-
โพสต์ล่าสุด โดย mindphp
10/08/2017 11:42 am
-
-
-
โพสต์ใหม่ Selenium IDE : การตั้งค่า Test Scheduler
โดย m028 » 10/07/2015 4:37 pm » ใน Software testing - 0 ตอบกลับ
- 1201 แสดง
-
โพสต์ล่าสุด โดย m028
10/07/2015 4:37 pm
-
ผู้ใช้งานขณะนี้
สมาชิกกำลังดูบอร์ดนี้: Google [Bot] และบุคลทั่วไป 78