AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |
Back to Blog
![]() Page Should Contain Element we're looking for a specific HTML element within a page. If you're familiar with Selenium, these keywords probably look familiar.Ĭlick Link sounds very familiar to Selenium users. Many of these are from the SeleniumLibrary. In fact, now that I look at it, they all come from libraries. The steps, in this case, almost all come from libraries. Suite Teardown Run Keywords Close Browser In exercise-06 we have an “extra large test.robot” file. 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. 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. Well, in general, keywords will start a line. The keywords here are Comment, and Open Browser. We make a comment, the comment is, "This is my first RobotFramework test case!"Īnd then, we open a browser, and we point it to a URL, and we tell it to use the Chrome browser. There are only two 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 there for you. 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. You'll notice that there is an “ example-settings.robot ” file. 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 will find keywords, and keyword documents. We're going to use a keyword in a test script. How to identify the correct syntax for a keyword. In this chapter, we're going to learn a few things. Keywords are a very important part of Robot Framework.
0 Comments
Read More
Leave a Reply. |