简体   繁体   中英

What is/are the java/javascript equivalent methods for commands in Selenium

Today is my 2nd day playing with selenium. Out of curiosity, is there a site with selenium commands and their equivalent javascript/java method?

I'm trying to create a jmeter test where it takes a Webdriver sampler and executes it. I got some commands from this site . About halfway down, they showed how selenium captured data can be converted to WebDriver format (screenshot below) 样品cmds )

This is a screenshot of my working "script" from selenium.

我们的硒cmds

I had tried the sample commands/scripts from this website here and they worked. However, I couldn't get my cmds from my script working because I couldn't figure out the equivalent js/java method to use. For example, I have a "waitforElementPresent" command in my "script". However, I couldn't find a waitforElementPresent or a addSelection method in the api (link found here ).

Is there a site out there that shows us which methods to use for which selenium command? Am I crazy and shouldn't be doing exploratory exercises like this? Thanks in advance for your help.

on http://www.seleniumhq.org/docs/ you can find a lot of information on the java commands/methods of selenium.

If you want to learn more about webDriver I would recommend to read the following documents http://www.seleniumhq.org/docs/03_webdriver.jsp

Just start at the beginning and practice with small pieces of code.

There is even easier way:

  1. Open your recorded testcase in Selenium IDE'
  2. Click File - Export TestCase As...
  3. Select desired language in which you want to learn (my assumption is Java - JUnit 4 - Webdriver)
  4. Open the file in your peferred IDE or text editor
  5. You will see all steps transferred into code, with it correct equivalents

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM