Showing posts with label General Knowledge. Show all posts
Showing posts with label General Knowledge. Show all posts

Robot Framework RIDE ติดตั้ง เริ่มเขียน - For Beginner

Robot Framework คืออะไร
เอาสั้นๆง่ายๆ คือโปรแกรมเอาไว้เขียนให้ระบบมันทำงานของตัวมันเอง ไม่ต้องไปทำซ้ำๆ เช่น เอาไว้แก้ Bug เวลาทำเว็บหรือระบบอะไรก็แล้วแต่ เริ่มกันเลย อย่ามัวเสียเวลา

การติดตั้ง ขอบอกว่าโคตรเยอะ จะมีปุ่มให้คลิกทีเดียวแล้วติดตั้งให้หมดเลยไม่ได้ ต้องมาติดตั้งทีละตัว และการ Download มาแต่ละโปรแกรมก็แสนจะเยอะ เจ้เลยรวมทุกอย่างไว้ที่นี่ ที่เดียวจบปะ

1. จง Download โปรแกรมดังต่อไปนี้ (คือ download มาให้ครบทีเดียวจะได้ไม่งง หรือใครจะงงก็ว่าไป)
     1.1 Python 2.7.x ไปที่ 
            https://www.python.org
     1.2 wxPython2.8-win64-unicode-2.8.12.1-py27 
          ไปที่ https://sourceforge.net/projects/wxpython/files/wxPython/2.8.12.1/
     1.3 Chrome Driver ไปที่
          
https://chromedriver.storage.googleapis.com/index.html?path=2.37/
           ตัวนี้ไม่ต้องก็ได้ หากใครไม่ได้ Test Script ผ่านทาง Browser

2. ลง Python ดับเบิ้ลคลิกที่ exe เลือกไปไว้ที่ C:\ หลังจากนั้นคลิก next อย่างเดียวหลังจากเปลี่ยน path ที่จะลงแล้ว

3. ไปที่ windows พิมพ์ cmd เพื่อเปิด command line (คงไม่ต้องบอกนะว่าอยู่ที่ไหน ถ้าหาไม่เจอก็ตรงซ้ายมือเมนูที่เราจะคลิกเข้าโปรแกรมนั้นแหล่ะ มีรูปแว่นขยายอยู่ หรือถ้า Windows เก่าหน่อยก็จะเป็นช่องให้ค้นหา พิมพ์เข้าไปเลย cmd แล้วกด enter)


4. จากนั้นให้พร้อมไปที่ Folder ที่เราเพิ่งลง Python ไปตามภาพ
5. ติดตั้งเครื่องมืือดังต่อไปนี้ ไม่ต้องถามว่ามันคืออะไร เพราะเจ้เองก็ไม่รู้อิๆ หลักง่ายๆคือ copy คำสั่งแล้วว่างที่ Command line หลัง C:\Python27> นะจ้ะ ขอย้ำว่าทุกคำสั่ง เพราะเจ้รวบรัดตัดตอน แต่ถ้าใครชอบแบบมีคำอธิบายเยอะ ลองคลิกเข้าไปที่นี่ คำเตือน ฝรั่งล้วนๆนะ แต่พอเดาได้
https://www.swtestacademy.com/getting-started-robotframework/

pip install robotframework กด Enter
python -m pip install -U pip กด Enter
robot --version กด Enter
rebot --version กด Enter


pip install --upgrade robotframework  กด Enter
pip install robotframework==2.9.2  กด Enter

ทำทีละคำสั่งหละ มันมีให้ กด Enter คั้นอยู่นะ


** ถ้า command line มันยาว ก็ปิดแล้วเข้าใหม่ ก็ทำต่อขั้นตอนถัดไปได้นะคะ

และจากนั้นให้ลง wxPython แล้วทำดังนี้ กด Next ดังภาพอย่างเดียว



ลงต่อหลังจากลง wxPython เสร็จ ยังทำที่ command line อยู่นะ ถ้าหลุดให้เข้าไปใหม่

pip install robotframework-ride   กด Enter
pip install robotframework-selenium2library    กด Enter
pip install --upgrade robotframework-selenium2library    กด Enter

pip install robotframework-selenium2library==1.4.1    กด Enter
pip install --upgrade selenium    กด Enter
pip install selenium==2.34    กด Enter

6. สุดท้ายละ ให้ลองพิมพ์คำว่า ride.py ใน command line แล้ว enter จะมีหน้าจอแสดงให้เราเขียนโค้ดแบบเก๋ๆดังภาพคะ

ทีนี้ก็โซโล่กันเลย ครั้งหน้าจะมาสอนการเปิด Browser แล้ว login เข้า facebook โดยใช้ Robot Framework หรือถ้าใครรอไม่ไหวเข้าไปที่นี่คะ
https://youtu.be/cmwCi1TGPC4




My knowledge will be here forever



Have you ever forgot some function name of program or some step to do some thing? ME! often ^_^ and The way I have tried to searching on google, sometime it fast and easy to get some answer but some time I have take long time to get some solution.

And if I have to asked some one in my office, some time they help and some time they were busy, I do not want to disturb them often and some of them were really help me but some of them were not happy when I asked them often and often T_T, YES! I understand that my brain have limited for memory and an other one may upset when they have to answer same question again and again then I have the way for me to help to remember and keep all knowledge as I ever had and will have in the future in here ^__^, If you afraid of your recognize, This way can help you. Happy and Enjoin!.