From the course: Cucumber Essential Training

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Invoke a page: Extract values

Invoke a page: Extract values

From the course: Cucumber Essential Training

Start my 1-month free trial

Invoke a page: Extract values

- [Instructor] So now that we have all the dependencies installed or copied, let's go ahead and write some web browser automation code. Let's go ahead and add the code to our Scenario Outline steps. I'm going to add a private method that will do browser automation. This will be a private method, and it will be called invokeWebPage. The first thing we need to do is set our system property to specify the path of the Chrome driver. So I'm going to add here System.set Property, and in the key, I'll provide webdriver.chrome.driver. In the value, I need to provide the path where I copied Chrome driver. So this is going to be C ChromeDriver chromedriver.exe. The next thing we need to do is extract values from our web page. So let's step to our web page and inspect its elements. This is my web page. I will go ahead and click on this Bill Amount, right-click Inspect, and I can see that the ID of this text box is billamount. I'll do the same thing for the Tax Rate, Inspect, and its ID is…

Contents