欧美三区_成人在线免费观看视频_欧美极品少妇xxxxⅹ免费视频_a级毛片免费播放_鲁一鲁中文字幕久久_亚洲一级特黄

Selenium Two Tutorial using IronPython and I

系統 2114 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元、自定義金額等您想捐的金額吧,站長會非常 感謝您的哦?。。?/p>

發表我的評論
最新評論 總共0條評論
主站蜘蛛池模板: 久久99热精品 | 成年在线视频免费视频观看 | 欧美 国产 综合 | 视频一区二区三区免费观看 | 综合爱爱| 日韩中文有码高清 | 欧美性免费视频 | 欧美一级α片毛片免费观看 | 日韩成人在线观看 | 免费一级毛片在线观看 | 天堂av免费观看 | 日色网站 | 久久精品二区 | 欧美αv | 亚洲精品久久久 | 91精品久久久久久久久久入口 | 久久亚洲国产高清 | 日韩中文一区二区三区 | 国产 日韩 欧美在线 | 久久影音先锋 | www.999abab.com| 国产成+人+亚洲+欧美+日韩 | 色婷婷99综合久久久精品 | 久久久久综合 | 色综合亚洲色综合久久网张柏芝 | 久久国产欧美日韩精品 | 日本无卡码免费一区二区三区 | 久久久精品一区二区三区 | 亚洲综合情 | 精品国产欧美一区二区 | 亚洲一区二区三区免费观看 | 久草在线观看首页 | 黄色免费毛片 | 国产三级在线观看 | 欧美不卡一区二区三区在线观看 | 欧美一区二区三区免费视频 | 亚洲 欧美 自拍偷拍 | 欧美精品一区二区三区免费播放 | 色两性午夜视频免费观看 | 国产精品视频26uuu | 亚洲第一在线 |