Selenium Forum: Functional And Regression Testing Tool.
Would you like to react to this message? Create an account in a few clicks or log in to continue.
Search
Display results as :
Advanced Search
Latest topics
AEM Training | Free Online DemoWed Apr 21, 2021 5:45 pmazharuddin
c# PageFactory - issue initializing elementsFri Nov 01, 2019 8:40 pmthegoatboy
Selenium making automatic connection to random urlsMon Jul 08, 2019 12:58 pmrepairtechsolutions1
How can we design the custom framework in Selenium RCMon Jun 24, 2019 2:26 pmrandybonnettes
What are the new features in Selenium 3.0Tue Jun 18, 2019 5:37 pmpappyvicky
What are you using Selenium for? Fri Apr 12, 2019 3:52 amzhl
LIMITATIONS OF SELENIUMWed Apr 10, 2019 11:23 amswara
Navigation
 Portal
 Index
 Memberlist
 Profile
 FAQ
 Search

Go down
avatar
gchandrasekaran82
Regular Participant
Regular Participant
Posts : 33
Join date : 2011-02-16

How to import python code in to selenium Empty How to import python code in to selenium

Wed Feb 16, 2011 8:57 pm
The below code which i have written in notepad and saved it as python file(.py)

When i import this file it is giving error loading file... How to solve this problem.



from selenium import selenium
import unittest, time, re

class RSRK Automation(unittest.TestCase):
def setUp(self):
self.verificationErrors = []
self.selenium = selenium("localhost", 4444, "*chrome", "https://secure02.monilink.co.uk/")
self.selenium.start()

def test_r_s_r_k _automation(self):
sel = self.selenium
sel.open("/matml-core/login.do?XMSISDN=447824877108&MATM-GUID=16d34a25d462c6c96e")
sel.type("username", "RSRK")
sel.type("password", "s10")
sel.click("_Continue1_button")
sel.wait_for_page_to_load("30000")
sel.click("link=Payments")
sel.wait_for_page_to_load("30000")
sel.click("link=Pay Credit Card")
sel.wait_for_page_to_load("30000")
sel.click("link=Select Card")
sel.wait_for_page_to_load("30000")
sel.click("link=exact:Fuel Credit Card ************2015 Due Date: 18/09/10")
sel.wait_for_page_to_load("30000")
sel.click("link=Select Account")
sel.wait_for_page_to_load("30000")
sel.click("link=Next 10")
sel.wait_for_page_to_load("30000")
sel.click("link=Test SCB Account 11111111111 Balance: INR 62000.00")
sel.wait_for_page_to_load("30000")
sel.type("amount", "126")
sel.type("transferDate", "200211")
sel.click("_Continue1_button")
sel.wait_for_page_to_load("30000")
sel.click("link=Edit")
sel.wait_for_page_to_load("30000")
sel.type("amount", "125")
sel.type("transferDate", "190211")
sel.click("_Continue1_button")
sel.wait_for_page_to_load("30000")
sel.click("link=Confirm")
sel.wait_for_page_to_load("30000")
sel.click("link=Make Another Payment")
sel.wait_for_page_to_load("30000")
sel.click("link=View and Pay Bills")
sel.wait_for_page_to_load("30000")
sel.click("_Select+bill1_button")
sel.wait_for_page_to_load("30000")
sel.click("link=B.S.N.L, MYSORE INR 135.00 due by 27/09/10")
sel.wait_for_page_to_load("30000")
sel.click("_Select+account+or+card2_button")
sel.wait_for_page_to_load("30000")
sel.click("link=Joint Account Created for Testing Purpose $$$$$$ 11111111112 Balance: INR 3550.00")
sel.wait_for_page_to_load("30000")
sel.type("paymentDateString", "200211")
sel.click("_Continue3_button")
sel.wait_for_page_to_load("30000")
sel.click("link=Edit")
sel.wait_for_page_to_load("30000")
sel.type("paymentDateString", "210211")
sel.click("_Continue3_button")
sel.wait_for_page_to_load("30000")
sel.click("link=Confirm")
sel.wait_for_page_to_load("30000")
sel.click("link=Make Another Payment")
sel.wait_for_page_to_load("30000")
sel.click("link=Bill Payment")
sel.wait_for_page_to_load("30000")
sel.click("_Select+a+biller1_button")
sel.wait_for_page_to_load("30000")
sel.click("link=B.S.N.L, INDORE 111111111111111")
sel.wait_for_page_to_load("30000")
sel.click("_Select+account+or+card2_button")
sel.wait_for_page_to_load("30000")
sel.click("link=Loan Account Created for Testing Purpose 11111111113 Balance: INR 2500.00")
sel.wait_for_page_to_load("30000")
sel.type("amount", "250")
sel.type("paymentDateString", "190211")
sel.click("_Continue3_button")
sel.wait_for_page_to_load("30000")
sel.click("link=Confirm")
sel.wait_for_page_to_load("30000")
sel.click("link=Make Another Payment")
sel.wait_for_page_to_load("30000")
sel.click("link=View Payments History")
sel.wait_for_page_to_load("30000")
sel.click("link=AIRTEL, BANGALORE 4940760300032009 24/10/10 INR 1010.0")
sel.wait_for_page_to_load("30000")
sel.click("link=View Another Payment")
sel.wait_for_page_to_load("30000")
sel.click("link=AIRTEL, BANGALORE 4940760300032009 24/10/10 INR 1010.0")
sel.wait_for_page_to_load("30000")
sel.click("link=View Another Payment")
sel.wait_for_page_to_load("30000")
sel.click("link=AIRTEL, BANGALORE 22500000220 10/10/10 INR 100.0")
sel.wait_for_page_to_load("30000")
sel.click("link=Main menu")
sel.wait_for_page_to_load("30000")
sel.click("link=Logout")
sel.wait_for_page_to_load("30000")
sel.click("link=Yes")
sel.wait_for_page_to_load("30000")

def tearDown(self):
self.selenium.stop()
self.assertEqual([], self.verificationErrors)

if __name__ == "__main__":
unittest.main()
Back to top
Permissions in this forum:
You cannot reply to topics in this forum