Quantcast
Channel: Active questions tagged selenium - Stack Overflow
Viewing all articles
Browse latest Browse all 97750

Changing test name in python unittest using selenium

$
0
0

I have a question. Is it possible to change the name test in output, using python unittests?

For example, my test:

from selenium import webdriver
import unittest
from data.readData import Data
from actions.actions import Actions
from pages.notificationsPage import NotificationsPage

class NotificationsTest(unittest.TestCase):

    @classmethod
    def setUpClass(cls):
        cls.driver = webdriver.Chrome(executable_path=Data.driver)
        cls.driver.implicitly_wait(10)
        cls.driver.maximize_window()

    def test_order_confirmation(self):
        Actions.login(self, Data.email, Data.password)
        driver = self.driver
        driver.get(Data.website + "Admin/Configuration/Message")
        notify = NotificationsPage(driver)
        notify.order_confirmation()

    @classmethod
    def tearDownClass(cls):
        cls.driver.close()
        cls.driver.quit()

if __name__ == '__main__':
    unittest.main()

And my output:

my test output screenshot

I want to change the marked one test name to own string here, in this output, and also in result file in res.xml (I think it is the same value).

Is it possible?


Viewing all articles
Browse latest Browse all 97750

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>