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

Selenium Two Tutorial using IronPython and I

系統(tǒng) 2029 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


更多文章、技術(shù)交流、商務(wù)合作、聯(lián)系博主

微信掃碼或搜索:z360901061

微信掃一掃加我為好友

QQ號(hào)聯(lián)系: 360901061

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

【本文對(duì)您有幫助就好】

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

發(fā)表我的評(píng)論
最新評(píng)論 總共0條評(píng)論
主站蜘蛛池模板: 亚洲精品人成在线观看 | 99热国产 | 国产青草视频免费观看97 | 国产一区二区三区免费 | 操亚洲| 美女视频免费在线观看 | 5060网午夜一级毛片在线看 | 中文字幕日韩精品在线 | 神马影院我不卡888 神马影院我不卡手机 | 久青草免费视频手机在线观看 | 成人毛片18岁女人毛片免费看 | 最近中文字幕在线视频1 | 亚洲第一成年网 | 一级二级三级毛片 | 亚洲欧美日韩在线观看你懂的 | 伊人国产在线 | 福利视频二区 | 日韩欧美成人免费中文字幕 | 亚洲精品乱码久久久久久 | 久久青草免费91线频观看站街 | 国产精品亚洲成在人线 | 日本三级强在线观看 | 91福利精品老师国产自产在线 | 99久久99久久精品免费看蜜桃 | 四虎在线永久精品高清 | 久久精品视频久久 | 爱爱99| 看黄色一级毛片 | 亚洲天天在线日亚洲洲精 | 国产主播第一页 | 久久一区二区免费播放 | 亚洲精品视频在线观看免费 | 久久无码精品一区二区三区 | 欧美综合图片区 | 国产91在线 | 中文 | 久久草视频 | 午夜精品久久久久久 | 亚洲婷婷综合中文字幕第一页 | 毛片黄片视频 | 久久精品国产亚洲欧美 | 日本中文字幕一区二区有码在线 |