亚洲免费在线-亚洲免费在线播放-亚洲免费在线观看-亚洲免费在线观看视频-亚洲免费在线看-亚洲免费在线视频

Selenium Two Tutorial using IronPython and I

系統 2395 0

Selenium Two Tutorial using IronPython and InternetExplorerDriver - The Automated Tester

Selenium Two Tutorial using IronPython and InternetExplorerDriver

Mon 11 Jan 2010

This tutorial is to show how to use the .NET Selenium 2 with dynamic languages that run on the .NET Common Language Runtime. This tutorial uses IronPython.

To complete this tutorial you will need to have IronPython installed and you will also need to download the .NET Bindings from Google Code

This tutorial will not be using the Remote Driver and it will be using the InternetExplorerDriver as this is the only complete browser at the moment that doesn't need to be built from the Repository .

?

  1. Lets start by creating a directory that will hold the IronPython script. Lets call it SeleniumTwoExamplePython
  2. Copy the WebDriver.Common.dll, WebDriver.IE.dll and InternetExplorerDriver.dll files into the newly created directory in the step above. Make sure the version of InternetExplorerDriver.dll matches the architecture of your operating system.
  3. We are now ready to have our write our first test!Copy the code below into a Python IDE or Notepad. Save the file as testgoogle.py
              import sys
    import unittest
     
    try:
      import clr
      clr.AddReference("WebDriver.Common.dll")
      clr.AddReference("WebDriver.IE.dll")
      from OpenQA.Selenium import *
      from OpenQA.Selenium.IE import *
    except ImportError:
      sys.exit("This needs to be run in IronPython")
      
    class TestGoogle(unittest.TestCase):
      def setUp(self):
        '''
    	   Start the driver
    	'''
        self.driver = InternetExplorerDriver()
     
      def testGoogleSearchForTheAutomatedTester(self):
        '''
           Test to have a load Google and the search for The Automated Tester
        '''
        #Navigate to the site
        self.driver.Navigate().GoToUrl("http://www.google.com/")
        #Create an object for an element on the page
        queryBox = self.driver.FindElement(By.Name("q"))
        queryBox.SendKeys("The Automated Tester")
        #Submit the form
        queryBox.Submit()
        #Check the title of the new page has The Automated Tester in the Title
        self.assertTrue("The Automated Tester" in self.driver.Title)
     
      def tearDown(self):
        '''
    	   Clean up the driver
    	'''
        self.driver.Quit()
     
    if __name__ == '__main__':
        unittest.main()
            
            
  4. Now you have a test that launch a browser and do a search on Google for you. In a command prompt run ipy testgoogle.py

?

Now you have created your first test that uses WebDriver.

Selenium Two Tutorial using IronPython and InternetExplorerDriver - The Automated Tester


更多文章、技術交流、商務合作、聯系博主

微信掃碼或搜索:z360901061

微信掃一掃加我為好友

QQ號聯系: 360901061

您的支持是博主寫作最大的動力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描下面二維碼支持博主2元、5元、10元、20元等您想捐的金額吧,狠狠點擊下面給點支持吧,站長非常感激您!手機微信長按不能支付解決辦法:請將微信支付二維碼保存到相冊,切換到微信,然后點擊微信右上角掃一掃功能,選擇支付二維碼完成支付。

【本文對您有幫助就好】

您的支持是博主寫作最大的動力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描上面二維碼支持博主2元、5元、10元、自定義金額等您想捐的金額吧,站長會非常 感謝您的哦!??!

發表我的評論
最新評論 總共0條評論
主站蜘蛛池模板: 一二三四社区在线播放 | 国内精品小视频在线 | 激情五月五月婷婷 | 国产免费一区二区在线看 | 激情综合网五月婷婷 | 色婷婷在线观看视频 | 日本黄色绿像 | 尤物久久99热国产综合 | 精品欧美一区手机在线观看 | 日本在线视频精品 | 色婷婷久久综合中文久久一本` | 日日夜夜天天久久 | 四虎影院国产 | 深夜影院a | 亚洲国产成人久久综合碰 | 高清欧美一区二区免费影视 | 一级特级欧美aa毛片免费 | 日批日韩在线观看 | 中文国产成人久久精品小说 | 狠狠色噜噜综合社区 | 四虎影视国产精品亚洲精品hd | 99热成人精品热久久66 | 国产精品自在欧美一区 | 品色视频 | 四虎综合九九色九九综合色 | 久久久精品日本一区二区三区 | 性生活视频网站 | 中国一级全黄的免费观看 | 可以免费观看欧美一级毛片 | 欧美亚洲欧美 | 狠狠色综合久久婷婷 | 97在线观看免费视频 | 午夜免费福利社 | 日本狠狠干 | 在线观看精品国语偷拍 | 日韩在线 中文字幕 | 97视频在线观看免费 | 97在线成人免费视频观看 | 香蕉伊人久久 | 婷婷丁香久久 | 亚洲一区二区精品推荐 |