Selenium Python Webdriver Tutorial - Test Framework

preview_player
Показать описание
This video tutorial teaches you how to write and run multiple tests using Python unittest with Selenium Python Webdriver bindings.
Рекомендации по теме
Комментарии
Автор

Hi there, I am enjoying your videos and am relatively new to Selenium and Python. I am taking an online course now which teaches how to use Wedriver and Python to automate the browser, but it is not teaching how to do the tests. Your video is helpful for that. However, I have a question about how to organize tests. For example, you have a class and there are 2 tests in it. Is the class considered the "test case", and each method considered like a part of that "test case", or is each method itself considered a test case?

My understanding is that the class is the test case. If that is the case, in professional development teams how are these organized exactly. Like, is 1 test case (class) created per file. So, if you have 100 test cases (classes) then you have 100 .py files sitting in some folder, and you can set it up so they execute one after the other?

Thanks a lot! If you have or know of a professional example where I can take a look at how lots of test cases are organized to make up a whole testing suite I would appreciate it.

Regards,

SAB15

sabyt
Автор

Hi Selenium Master,

I made the below code and tried to run it from my powershell command line and nothing happens. Can you tell me why? Are the setup and teardown methods required?

import unittest

def fun(x):
return x + 1

class MyTest(unittest.TestCase):
def test(self):
self.assertEqual(fun(3), 4)

sabyt
Автор

Hi.

Thanks for the video. I have 2 simple questions

1) Does the order of the tests matter ? For example in my script, although I wrote the tag test then the licence test, it runs first the licence test, then it runs the tag test. Is that really important, or is there a way for me to give sequence of tests?

2)where did you get the xpath for the selected option ? I could not found it in the source code of the page. I simply write what you wrote here but It seems to fail to locate that elements.

Thanks in advance! I can really easily keep up to your videos even though I am almost a complete beginner.

mByyurt
visit shbcf.ru