Search
 
 

Display results as :
 


Rechercher Advanced Search

Latest topics
» Selenium Script issue
Tue Dec 06, 2016 9:48 pm by njain213

» Difference between QTP, Selenium and Silk test
Tue Dec 06, 2016 7:58 pm by jessicacyrus1

» Where does selenium script pick browser from
Tue Dec 06, 2016 1:52 pm by janbaskt

» Safari throws an HTTP ERROR: 404
Tue Dec 06, 2016 1:51 pm by janbaskt

» Access Denied Error in Selenium RC
Tue Dec 06, 2016 1:51 pm by janbaskt

» Automating Flex application through selenium webdriver
Fri Dec 02, 2016 2:06 pm by abhinay.krs

» Starting with Selenium, what is Selenium?
Mon Nov 28, 2016 4:00 pm by Foma

» Getting started with Selenium
Mon Nov 28, 2016 3:23 pm by Rebbelx

» Selenium IDE Verify different Maps (Hybridview, Mapview etc.)
Fri Nov 25, 2016 9:56 pm by DJ87

Navigation
 Portal
 Index
 Memberlist
 Profile
 FAQ
 Search

How to import python code in to selenium

View previous topic View next topic Go down

How to import python code in to selenium

Post by gchandrasekaran82 on 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()

gchandrasekaran82
Regular Participant
Regular Participant

Posts : 33
Join date : 2011-02-16

Back to top Go down

View previous topic View next topic Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum