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?










share|improve this question























  • A class BaseTest seems not part of standard library's unittest package. Where does it come from?
    – Michael Butscher
    Nov 10 at 22:39














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?










share|improve this question























  • A class BaseTest seems not part of standard library's unittest package. Where does it come from?
    – Michael Butscher
    Nov 10 at 22:39












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?










share|improve this question















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






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 9 at 21:17

























asked Nov 9 at 21:09









Uz_IT

11




11











  • 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















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












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.






share|improve this answer






















  • 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










Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













 

draft saved


draft discarded


















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

























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.






share|improve this answer






















  • 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














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.






share|improve this answer






















  • 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












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.






share|improve this answer














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.







share|improve this answer














share|improve this answer



share|improve this answer








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
















  • 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

















 

draft saved


draft discarded















































 


draft saved


draft discarded














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





















































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







Popular posts from this blog

How to how show current date and time by default on contact form 7 in WordPress without taking input from user in datetimepicker

Syphilis

Darth Vader #20