I tried to execute the below code on Python IDE - I am using selenium RC
from selenium import selenium
import unittest, time, re
class test(unittest.TestCase):
def setUp(self):
self.verificationErrors = []
self.selenium = selenium("localhost", 4444, "*iexploreproxy", "MY URL/")
self.selenium.start()
def test(self):
sel = self.selenium
sel.open("MY URL")
sel.type("username", "krish_test1")
sel.type("password", "t04ster")
sel.click("//input[@value='submit']")
def tearDown(self):
self.selenium.stop()
self.assertEqual([], self.verificationErrors)
if __name__ == "__main__":
unittest.main()
I get the following error messages:
ERROR: test (__main__.test)
Traceback (most recent call last):
File "C:\Python\test.py", line 12, in test
sel.open("MY URL")
File "C:\Python\selenium.py", line 764, in open
self.do_command("open", [url,])
File "C:\Python\selenium.py", line 215, in do_command
raise Exception, data
Exception: XHR ERROR: URL = MY URL Response_Code = 403 Error_Message = Forbidden
Ran 1 test in 4.953s
FAILED (errors=1)
Traceback (most recent call last):
File "C:\Python\test.py", line 22, in <module>
unittest.main()
File "C:\Python27\lib\unittest\main.py", line 95, in __init__
self.runTests()
File "C:\Python27\lib\unittest\main.py", line 231, in runTests
sys.exit(not self.result.wasSuccessful())
SystemExit: True
>>>
Can anyone help me please?