Selenium Python setting test to pass
Just starting out with selenium using python using the example on cross browser testing.
Im only doing a simple script to start but its not setting the status to pass although I have this
self.test_result = 'pass'
full script
import unittest
from selenium import webdriver
import requests
class RAPLogin(unittest.TestCase):
def setUp(self):
self.username = "jade.laird@tharstern.com"
self.authkey = "u289162f9a08ba06"
self.api_session = requests.Session()
self.api_session.auth = (self.username,self.authkey)
self.test_result = None
caps = {}
caps['name'] = 'RAP - Login'
caps['browserName'] = 'Chrome'
caps['version'] = '60x64'
caps['platform'] = 'Windows 10'
caps['screenResolution'] = '1366x768'
caps['record_video'] = 'true'
self.driver = webdriver.Remote(
desired_capabilities=caps,
command_executor="http://%s:%s@hub.crossbrowsertesting.com:80/wd/hub"%(self.username,self.authkey)
)
self.driver.implicitly_wait(20)
def test_CBT(self):
self.driver.get('http://localhost/RAP/Auth/Login?ReturnUrl=%2FRAP')
self.assertEqual("Login Page - Remote Access Portal", self.driver.title)
self.test_result = 'pass'
self.driver.quit()
if __name__ == '__main__':
unittest.main()