Selecting dropdown in WebDriverJs

后端 未结 15 1167
星月不相逢
星月不相逢 2020-12-29 07:48

I have a dropdown box that I would like to select a value using WebDriverJS. I\'ve looked at the user guide below and could not find out how to do it

15条回答
  •  无人及你
    2020-12-29 07:54

    The following code defines the available selectors in WebDriverJS:

    webdriver.Locator.Strategy = {
      'className': webdriver.Locator.factory_('class name'),
      'class name': webdriver.Locator.factory_('class name'),
      'css': webdriver.Locator.factory_('css selector'),
      'id': webdriver.Locator.factory_('id'),
      'js': webdriver.Locator.factory_('js'),
      'linkText': webdriver.Locator.factory_('link text'),
      'link text': webdriver.Locator.factory_('link text'),
      'name': webdriver.Locator.factory_('name'),
      'partialLinkText': webdriver.Locator.factory_('partial link text'),
      'partial link text': webdriver.Locator.factory_('partial link text'),
      'tagName': webdriver.Locator.factory_('tag name'),
      'tag name': webdriver.Locator.factory_('tag name'),
      'xpath': webdriver.Locator.factory_('xpath')
    };
    
    goog.exportSymbol('By', webdriver.Locator.Strategy);
    

    Source: https://code.google.com/p/selenium/source/browse/javascript/webdriver/locators.js

提交回复
热议问题