Search
 
 

Display results as :
 


Rechercher Advanced Search

Latest topics
» Regarding Alert Interface
Fri Feb 24, 2017 2:00 pm by karthikeyakumar

» Geting issues in identifying the elsements in webdriver
Fri Feb 17, 2017 4:41 pm by janbaskt

» WebDriver - why not to use a singlton for it?
Fri Feb 17, 2017 4:40 pm by janbaskt

» WebDriver session when using testng annotation to invoke driver instance
Fri Feb 17, 2017 4:39 pm by janbaskt

» Selenium fails to launch Chrome
Fri Feb 17, 2017 4:39 pm by janbaskt

» why do i get this error
Fri Feb 17, 2017 4:38 pm by janbaskt

» Selenium Tutorial
Thu Feb 16, 2017 5:21 pm by Rahul

» When to use Selenium IDE, RC and WebDriver
Mon Feb 13, 2017 2:35 pm by azharuddin

» How to integrate selenium with ZAPI-Zephyr
Sat Feb 11, 2017 2:25 am by gseera002c

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