AttributeError: 'module' object has no attribute 'runTest'
up vote
0
down vote
favorite
I know questions like these have already been asked, but I could not find answer in comments to those questions. Please help me here.
I have the following page object:
class ChatInput(BaseTest):
def __init__(self, driver, *args, **kwargs):
super(ChatInput, self).__init__(*args, **kwargs)
self.driver = driver
def get_chat_Input(self):
return self.wait_for_element_by_xpath(elements.CHAT_INPUT, 60)
def add_content_in_chatInput(self, msg):
chatInput = self.get_chat_Input()
chatInput.clear()
chatInput.click()
chatInput.send_keys('')
chatInput.send_keys(msg)
return True
I am calling the methods from this page object to my test class.
from .components.ChatInput import ChatInput
class SmokeTest(BaseTest):
def test_everything(self):
env = self.getEnvConfig()
for driver in env['DRIVERS']:
self.configDriver(driver)
self.driver.get(CONFIG.SITE_URL)
self.chatInput = ChatInput(self.driver)
assert self.chatInput.add_content_in_chatInput('Hello, this is agent QA. Please tell us, how we can help you today?')
But when I run my test, I am getting following error:
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/unittest/suite.py", line 84, in __call__
return self.run(*args, **kwds)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/unittest/suite.py", line 122, in run
test(result)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/unittest/case.py", line 663, in __call__
return self.run(*args, **kwds)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/unittest/case.py", line 590, in run
testMethod = getattr(self, self._testMethodName)
AttributeError: 'ChatInput' object has no attribute 'runTest'
Please let me know what am I doing wrong?
python selenium selenium-webdriver
add a comment |
up vote
0
down vote
favorite
I know questions like these have already been asked, but I could not find answer in comments to those questions. Please help me here.
I have the following page object:
class ChatInput(BaseTest):
def __init__(self, driver, *args, **kwargs):
super(ChatInput, self).__init__(*args, **kwargs)
self.driver = driver
def get_chat_Input(self):
return self.wait_for_element_by_xpath(elements.CHAT_INPUT, 60)
def add_content_in_chatInput(self, msg):
chatInput = self.get_chat_Input()
chatInput.clear()
chatInput.click()
chatInput.send_keys('')
chatInput.send_keys(msg)
return True
I am calling the methods from this page object to my test class.
from .components.ChatInput import ChatInput
class SmokeTest(BaseTest):
def test_everything(self):
env = self.getEnvConfig()
for driver in env['DRIVERS']:
self.configDriver(driver)
self.driver.get(CONFIG.SITE_URL)
self.chatInput = ChatInput(self.driver)
assert self.chatInput.add_content_in_chatInput('Hello, this is agent QA. Please tell us, how we can help you today?')
But when I run my test, I am getting following error:
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/unittest/suite.py", line 84, in __call__
return self.run(*args, **kwds)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/unittest/suite.py", line 122, in run
test(result)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/unittest/case.py", line 663, in __call__
return self.run(*args, **kwds)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/unittest/case.py", line 590, in run
testMethod = getattr(self, self._testMethodName)
AttributeError: 'ChatInput' object has no attribute 'runTest'
Please let me know what am I doing wrong?
python selenium selenium-webdriver
A classBaseTest
seems not part of standard library'sunittest
package. Where does it come from?
– Michael Butscher
Nov 10 at 22:39
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I know questions like these have already been asked, but I could not find answer in comments to those questions. Please help me here.
I have the following page object:
class ChatInput(BaseTest):
def __init__(self, driver, *args, **kwargs):
super(ChatInput, self).__init__(*args, **kwargs)
self.driver = driver
def get_chat_Input(self):
return self.wait_for_element_by_xpath(elements.CHAT_INPUT, 60)
def add_content_in_chatInput(self, msg):
chatInput = self.get_chat_Input()
chatInput.clear()
chatInput.click()
chatInput.send_keys('')
chatInput.send_keys(msg)
return True
I am calling the methods from this page object to my test class.
from .components.ChatInput import ChatInput
class SmokeTest(BaseTest):
def test_everything(self):
env = self.getEnvConfig()
for driver in env['DRIVERS']:
self.configDriver(driver)
self.driver.get(CONFIG.SITE_URL)
self.chatInput = ChatInput(self.driver)
assert self.chatInput.add_content_in_chatInput('Hello, this is agent QA. Please tell us, how we can help you today?')
But when I run my test, I am getting following error:
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/unittest/suite.py", line 84, in __call__
return self.run(*args, **kwds)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/unittest/suite.py", line 122, in run
test(result)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/unittest/case.py", line 663, in __call__
return self.run(*args, **kwds)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/unittest/case.py", line 590, in run
testMethod = getattr(self, self._testMethodName)
AttributeError: 'ChatInput' object has no attribute 'runTest'
Please let me know what am I doing wrong?
python selenium selenium-webdriver
I know questions like these have already been asked, but I could not find answer in comments to those questions. Please help me here.
I have the following page object:
class ChatInput(BaseTest):
def __init__(self, driver, *args, **kwargs):
super(ChatInput, self).__init__(*args, **kwargs)
self.driver = driver
def get_chat_Input(self):
return self.wait_for_element_by_xpath(elements.CHAT_INPUT, 60)
def add_content_in_chatInput(self, msg):
chatInput = self.get_chat_Input()
chatInput.clear()
chatInput.click()
chatInput.send_keys('')
chatInput.send_keys(msg)
return True
I am calling the methods from this page object to my test class.
from .components.ChatInput import ChatInput
class SmokeTest(BaseTest):
def test_everything(self):
env = self.getEnvConfig()
for driver in env['DRIVERS']:
self.configDriver(driver)
self.driver.get(CONFIG.SITE_URL)
self.chatInput = ChatInput(self.driver)
assert self.chatInput.add_content_in_chatInput('Hello, this is agent QA. Please tell us, how we can help you today?')
But when I run my test, I am getting following error:
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/unittest/suite.py", line 84, in __call__
return self.run(*args, **kwds)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/unittest/suite.py", line 122, in run
test(result)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/unittest/case.py", line 663, in __call__
return self.run(*args, **kwds)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/unittest/case.py", line 590, in run
testMethod = getattr(self, self._testMethodName)
AttributeError: 'ChatInput' object has no attribute 'runTest'
Please let me know what am I doing wrong?
python selenium selenium-webdriver
python selenium selenium-webdriver
edited Nov 9 at 21:17
asked Nov 9 at 21:09
Uz_IT
11
11
A classBaseTest
seems not part of standard library'sunittest
package. Where does it come from?
– Michael Butscher
Nov 10 at 22:39
add a comment |
A classBaseTest
seems not part of standard library'sunittest
package. Where does it come from?
– Michael Butscher
Nov 10 at 22:39
A class
BaseTest
seems not part of standard library's unittest
package. Where does it come from?– Michael Butscher
Nov 10 at 22:39
A class
BaseTest
seems not part of standard library's unittest
package. Where does it come from?– Michael Butscher
Nov 10 at 22:39
add a comment |
1 Answer
1
active
oldest
votes
up vote
0
down vote
It seems you are trying to test a method called runTest. Or more specifically, while testing you are tying to run ChatInput.runTest, which doesn't exist. That is what the error message is saying.
There is no method named 'runTest' in my code. Also, I am not trying to run that method. I am calling the method "add_content_in_chatInput()" in my test class
– Uz_IT
Nov 10 at 5:59
Exactly, there is no method called ChatInput.runTest, but whatever you are doing is trying to call it. From the information that you've provided there isn't really more I can say
– Karl
Nov 10 at 7:07
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
It seems you are trying to test a method called runTest. Or more specifically, while testing you are tying to run ChatInput.runTest, which doesn't exist. That is what the error message is saying.
There is no method named 'runTest' in my code. Also, I am not trying to run that method. I am calling the method "add_content_in_chatInput()" in my test class
– Uz_IT
Nov 10 at 5:59
Exactly, there is no method called ChatInput.runTest, but whatever you are doing is trying to call it. From the information that you've provided there isn't really more I can say
– Karl
Nov 10 at 7:07
add a comment |
up vote
0
down vote
It seems you are trying to test a method called runTest. Or more specifically, while testing you are tying to run ChatInput.runTest, which doesn't exist. That is what the error message is saying.
There is no method named 'runTest' in my code. Also, I am not trying to run that method. I am calling the method "add_content_in_chatInput()" in my test class
– Uz_IT
Nov 10 at 5:59
Exactly, there is no method called ChatInput.runTest, but whatever you are doing is trying to call it. From the information that you've provided there isn't really more I can say
– Karl
Nov 10 at 7:07
add a comment |
up vote
0
down vote
up vote
0
down vote
It seems you are trying to test a method called runTest. Or more specifically, while testing you are tying to run ChatInput.runTest, which doesn't exist. That is what the error message is saying.
It seems you are trying to test a method called runTest. Or more specifically, while testing you are tying to run ChatInput.runTest, which doesn't exist. That is what the error message is saying.
edited Nov 13 at 7:07
answered Nov 9 at 21:37
Karl
1,86842951
1,86842951
There is no method named 'runTest' in my code. Also, I am not trying to run that method. I am calling the method "add_content_in_chatInput()" in my test class
– Uz_IT
Nov 10 at 5:59
Exactly, there is no method called ChatInput.runTest, but whatever you are doing is trying to call it. From the information that you've provided there isn't really more I can say
– Karl
Nov 10 at 7:07
add a comment |
There is no method named 'runTest' in my code. Also, I am not trying to run that method. I am calling the method "add_content_in_chatInput()" in my test class
– Uz_IT
Nov 10 at 5:59
Exactly, there is no method called ChatInput.runTest, but whatever you are doing is trying to call it. From the information that you've provided there isn't really more I can say
– Karl
Nov 10 at 7:07
There is no method named 'runTest' in my code. Also, I am not trying to run that method. I am calling the method "add_content_in_chatInput()" in my test class
– Uz_IT
Nov 10 at 5:59
There is no method named 'runTest' in my code. Also, I am not trying to run that method. I am calling the method "add_content_in_chatInput()" in my test class
– Uz_IT
Nov 10 at 5:59
Exactly, there is no method called ChatInput.runTest, but whatever you are doing is trying to call it. From the information that you've provided there isn't really more I can say
– Karl
Nov 10 at 7:07
Exactly, there is no method called ChatInput.runTest, but whatever you are doing is trying to call it. From the information that you've provided there isn't really more I can say
– Karl
Nov 10 at 7:07
add a comment |
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53233298%2fattributeerror-module-object-has-no-attribute-runtest%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
A class
BaseTest
seems not part of standard library'sunittest
package. Where does it come from?– Michael Butscher
Nov 10 at 22:39