crex
crex

Reputation: 3

Python OOP method call

I have 2 different classes:

Automation and ClickElement

Window = Automation()
click_element = ClickElement()

In the class ClickElement is a method called 'by_span_name(name)'

Now i want to call the method in this way:

Window.click_element.by_span_name(name)

How do i do that? If i try it like this way, Pycharm doesn´t suggest any class after the first dot of Window.click_elem... Does click_element have to inherit form Window?

Upvotes: 0

Views: 41

Answers (1)

Hashir Irfan
Hashir Irfan

Reputation: 334

You can add ClickElement as a composed object in Automation

Window = Automation()
Window.click_element = ClickElement()

Upvotes: 1

Related Questions