![]() ![]() But I want to show you what the SeleniumLibrary documentation looks like, and where you can go to find it. We've already installed the SeleniumLibrary on this machine when you did the setup steps. A number of libraries have already been created for you for Robot Framework. In it, we can use a library to pull in keywords to make them available to us to use. Click Link and Input Text are also SeleniumLibrary keywords to help us navigate an HTML webpage.īut where are we getting the functionality for these keywords?.Page Should Contain Element we're looking for a specific HTML element on the page.Click Link sounds very familiar to Selenium users.If you're familiar with Selenium, these keywords probably look familiar. In fact, most of them come from the SeleniumLibrary. The steps, in this case, almost all come from libraries. This is a really long test case it does a lot of steps. Select From List By Value selectStatus Past Due ![]() Suite Teardown Run Keywords Close Browser Take a look at the 007-BasicsOfKeywords directory and open up the file called extra-large-test.robot. Instead, what I'd like to do is look at another example of keywords and help you understand where keywords come from. So, I'm not going to give you the answer right here. Where did these come from? Well, that's the challenge I want you to figure out in this test case. The arguments are the URL, and the type of browser to use. Open Browser is going to open the browser. The second line here uses a different keyword called Open Browser. In this case, we're going to make a comment when the test case runs saying, "This is my first RobotFramework test case!" Keywords are always defined by having 2 or more spaces between the keyword (in this case Comment) and an argument (in this case the String, "This is my first RobotFramework test case!").Īn argument is a piece of information we give a keyword to tell it to do something special. How did I know that? Well, in general keywords will start a line. The keywords here are Comment and Open Browser. And then, we open a browser, we point it to a URL, and we tell it to use the Chrome browser.We make a comment, and the comment is, "This is my first RobotFramework test case!".There are only 2 steps to this test case: This test case is called "Create An Invoice". Test cases, once again, are named and defined by being left justified. We've got a reference sheet for you there. If you need a cheat sheet for this, and other pieces of Robot Framework make sure to look it up on the website. We talked about test cases briefly earlier. But I know you guys don't want to cheat.Ī keyword is a piece of functionality in a test case. The answer, in case you want to cheat, is in the file. The robot file in this case is example-settings.robot. In each of the exercises I'm going to have a challenge for you, and that challenge is going to be set up with a file in the exercise. In this directory you'll find a file called example-settings.robot. We're going to talk about using those created in libraries first. There are 2 main ways to use keywords in your script - one is by a library the other is by creating it yourself. We’ll find keywords in keyword documents.We're going to use a keyword in a test script.We're going to learn how to identify the correct syntax for a keyword.We're going to learn what a keyword is.In this chapter, we're going to learn a few things. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |