I'm trying to generate random title for an auction and then use it outside the method.
add_consignment.py:
class AddConsignmentPage(BasePage):
def __init__(self, driver):
super(AddConsignmentPage, self).__init__(driver, self._title)
self._title_uuid = get_random_uuid(7)
inst = AddConsignmentPage(AddConsignmentPage)
and I want to use the same _title_uuid to view added consignment (type its title into search field)
view_consignments.py
from pages.add_consignment import inst
class ViewConsignmentsPage(BasePage):
_title_uuid = inst._title_uuid
def check_added_consignment(self):
self.send_keys(self._title_uuid, self._auction_search)
In this scenario the title is generated two times so title in added consignment is different than title in search field
So how to pass the value of _title_uuid from AddConsignmentPage to ViewConsignmentsPage? I want it to be the same in two methods, but different for every consignment(test case)
How to get it generated once for every consignment?