Class CommonSteps

    • Field Detail

      • properties

        public java.util.Properties properties
    • Constructor Detail

      • CommonSteps

        public CommonSteps​(TestContext testContext)
    • Method Detail

      • i_open_page

        @When("^I open (.+) page$")
        public void i_open_page​(java.lang.String pageName)
                         throws java.lang.Exception
        Throws:
        java.lang.Exception
      • i_click_Tab

        @When("^I click tab (.+)$")
        public void i_click_Tab​(java.lang.String tabName)
                         throws java.lang.Exception
        Throws:
        java.lang.Exception
      • i_click_Text

        @When("^I click text (.+)$")
        public void i_click_Text​(java.lang.String text)
                          throws java.lang.Exception
        Throws:
        java.lang.Exception
      • i_click_Text_On_Sequence

        @When("^I click webelement text (.+) on sequence (\\d+)$")
        public void i_click_Text_On_Sequence​(java.lang.String text,
                                             int sequenceNumber)
                                      throws java.lang.Exception
        Throws:
        java.lang.Exception
      • i_select_Date_Value

        @When("^I select date value (.+)$")
        public void i_select_Date_Value​(java.lang.String dateValue)
                                 throws java.lang.Exception
        Throws:
        java.lang.Exception
      • i_open_app

        @When("^I open app (.+)$")
        public void i_open_app​(java.lang.String appName)
                        throws java.lang.Exception
        Throws:
        java.lang.Exception
      • i_click_button_next_to_text

        @When("^I click Add button next to text (.+)$")
        public void i_click_button_next_to_text​(java.lang.String text)
                                         throws java.lang.Exception
        Throws:
        java.lang.Exception
      • i_click_Text_WithId

        @When("^I click button (.+) with id (.+)$")
        public void i_click_Text_WithId​(java.lang.String text,
                                        java.lang.String id)
                                 throws java.lang.Exception
        Throws:
        java.lang.Exception
      • i_click_Text_WithXpath

        @When("^I click button (.+) with xpath (.+)$")
        public void i_click_Text_WithXpath​(java.lang.String text,
                                           java.lang.String xpath)
                                    throws java.lang.Exception
        Throws:
        java.lang.Exception
      • send_keys_xpath

        @When("^I fill input field element with xpath (.+) using send keys with input (.+)$")
        public void send_keys_xpath​(java.lang.String xpath,
                                    java.lang.String input)
                             throws java.lang.Exception
        Throws:
        java.lang.Exception
      • send_keys_with_locator_path_with_data_path

        @When("^I fill input field element with locator (.+) using send keys with data (.+)$")
        public void send_keys_with_locator_path_with_data_path​(java.lang.String locatorPath,
                                                               java.lang.String dataPath)
                                                        throws java.lang.Exception
        Throws:
        java.lang.Exception
      • send_keys_locator_path_with_input

        @When("^I fill input field element with locator (.+) using send keys with input (.+)$")
        public void send_keys_locator_path_with_input​(java.lang.String locatorPath,
                                                      java.lang.String input)
                                               throws java.lang.Exception
        Throws:
        java.lang.Exception
      • i_wait_element_visible

        @When("^I wait for element (.+) to be visible$")
        public void i_wait_element_visible​(java.lang.String locatorPath)
                                    throws java.lang.Exception
        Throws:
        java.lang.Exception
      • i_wait_element_clikable

        @When("^I wait for element (.+) to be clickable$")
        public void i_wait_element_clikable​(java.lang.String locatorPath)
                                     throws java.lang.Exception
        Throws:
        java.lang.Exception
      • i_wait_element_visible_xpath

        @When("^I wait for xpath (.+) to be visible$")
        public void i_wait_element_visible_xpath​(java.lang.String xpath)
                                          throws java.lang.Exception
        Throws:
        java.lang.Exception
      • i_wait_element_not_visible

        @When("^I wait for element (.+) to not be visible$")
        public void i_wait_element_not_visible​(java.lang.String locatorPath)
                                        throws java.lang.Exception
        Throws:
        java.lang.Exception
      • i_wait_element_not_visible_xpath

        @When("^I wait for element with xpath (.+) to not be visible$")
        public void i_wait_element_not_visible_xpath​(java.lang.String xpath)
                                              throws java.lang.Exception
        Throws:
        java.lang.Exception
      • i_wait_loading_locator

        @When("^If I see loading element with locator (.+) I wait until complete$")
        public void i_wait_loading_locator​(java.lang.String locatorPath)
                                    throws java.lang.Exception
        Throws:
        java.lang.Exception
      • i_drag_drop

        @When("^I drag element (.+) and drop to element (.+)$")
        public void i_drag_drop​(java.lang.String locatorPathFrom,
                                java.lang.String locatorPathTo)
                         throws java.lang.Exception
        Throws:
        java.lang.Exception
      • i_fill_Field_WithXpathandValue

        @When("^I fill field (.+) with xpath (.+) with value (.+)$")
        public void i_fill_Field_WithXpathandValue​(java.lang.String text,
                                                   java.lang.String xpath,
                                                   java.lang.String value)
                                            throws java.lang.Exception
        Throws:
        java.lang.Exception
      • i_upload_Field_WithXpathAndFilepath

        @When("^I upload field (.+) with xpath (.+) with filePath (.+)$")
        public void i_upload_Field_WithXpathAndFilepath​(java.lang.String text,
                                                        java.lang.String xpath,
                                                        java.lang.String filePath)
                                                 throws java.lang.Exception
        Throws:
        java.lang.Exception
      • i_upload_Field_WithLocatorPathAndFilepath

        @When("^I upload field (.+) with locator path (.+) with filePath (.+)$")
        public void i_upload_Field_WithLocatorPathAndFilepath​(java.lang.String text,
                                                              java.lang.String locatorPath,
                                                              java.lang.String filePath)
                                                       throws java.lang.Exception
        Throws:
        java.lang.Exception
      • i_fill_Field_WithValue

        @When("^I fill input (.+) with value (.+)$")
        public void i_fill_Field_WithValue​(java.lang.String locatorPath,
                                           java.lang.String value)
                                    throws java.lang.Exception
        Throws:
        java.lang.Exception
      • i_fill_Field_WithData

        @When("^I fill input (.+) with data (.+)$")
        public void i_fill_Field_WithData​(java.lang.String locatorPath,
                                          java.lang.String dataPath)
                                   throws java.lang.Exception
        Throws:
        java.lang.Exception
      • i_fill_Field_With_Stored_Data

        @When("^I fill input (.+) with stored data (.+)$")
        public void i_fill_Field_With_Stored_Data​(java.lang.String locatorPath,
                                                  java.lang.String dataPath)
                                           throws java.lang.Exception
        Throws:
        java.lang.Exception
      • i_verify_web_text_contains_via_data_json

        @When("^I verify data (.+) is present in element (.+)$")
        public void i_verify_web_text_contains_via_data_json​(java.lang.String dataPath,
                                                             java.lang.String locatorPath)
                                                      throws java.lang.Exception
        Throws:
        java.lang.Exception
      • getLastLocator

        public java.lang.String getLastLocator​(java.lang.String locatorPath)
      • i_clear_field_locator

        @When("^I clear input field element with locator (.+)$")
        public void i_clear_field_locator​(java.lang.String locatorPath)
                                   throws java.lang.Exception
        Throws:
        java.lang.Exception
      • i_fill_field_withValue_on_seeingElement

        @When("^If I see element (.+) then I fill input (.+) with value (.+)$")
        public void i_fill_field_withValue_on_seeingElement​(java.lang.String conditionLocatorPath,
                                                            java.lang.String locatorPath,
                                                            java.lang.String value)
                                                     throws java.lang.Exception
        Throws:
        java.lang.Exception
      • i_click_element_on_seeingElement

        @When("^If I see element (.+) then I click element (.+)$")
        public void i_click_element_on_seeingElement​(java.lang.String conditionLocatorPath,
                                                     java.lang.String locatorPath)
                                              throws java.lang.Exception
        Throws:
        java.lang.Exception
      • i_fill_Field_With_encryptedPassword

        @When("^I fill input (.+) with encrypted password (.+)$")
        public void i_fill_Field_With_encryptedPassword​(java.lang.String locatorPath,
                                                        java.lang.String value)
                                                 throws java.lang.Exception
        Throws:
        java.lang.Exception
      • i_fill_Field_WithIdandValue

        @When("^I fill field (.+) with id (.+) with value (.+)$")
        public void i_fill_Field_WithIdandValue​(java.lang.String text,
                                                java.lang.String id,
                                                java.lang.String value)
                                         throws java.lang.Exception
        Throws:
        java.lang.Exception
      • i_check_item_has_price

        @When("^I check item (.+) has price (.+)$")
        public void i_check_item_has_price​(java.lang.String itemName,
                                           java.lang.String price)
                                    throws java.lang.Exception
        Throws:
        java.lang.Exception
      • switchToIframeWithLocator

        @Then("^I switch to iframe with locator (.+)$")
        public void switchToIframeWithLocator​(java.lang.String locatorPath)
                                       throws java.io.IOException
        Throws:
        java.io.IOException
      • i_click_element_captcha

        @When("^I click captcha element (.+)$")
        public void i_click_element_captcha​(java.lang.String locatorPath)
                                     throws java.lang.Exception
        Throws:
        java.lang.Exception
      • switch_default

        @When("^I switch to default content$")
        public void switch_default()
                            throws java.lang.Exception
        Throws:
        java.lang.Exception
      • i_set_length

        @When("^I set length of random string (.+)$")
        public void i_set_length​(java.lang.String text)
                          throws java.lang.Exception
        Throws:
        java.lang.Exception
      • i_select_dropdown_value

        @When("^I select the dropdown with id (.+) and select value (.+)$")
        public void i_select_dropdown_value​(java.lang.String selectId,
                                            java.lang.String dropDownValue)
                                     throws java.lang.Exception
        Throws:
        java.lang.Exception
      • i_select_dropdown_value_withXpath

        @When("^I select the dropdown element (.+) and select value (.+)$")
        public void i_select_dropdown_value_withXpath​(java.lang.String selectXpath,
                                                      java.lang.String dropDownValue)
                                               throws java.lang.Exception
        Throws:
        java.lang.Exception
      • i_select_dropdown_value_with_index

        @When("^I select the dropdown with id (.+) and index (.+)$")
        public void i_select_dropdown_value_with_index​(java.lang.String selectId,
                                                       java.lang.String index)
                                                throws java.lang.Exception
        Throws:
        java.lang.Exception
      • i_fillfield_inputlabel_value

        @When("^I fill inputelement with label (.+) with value (.+)$")
        public void i_fillfield_inputlabel_value​(java.lang.String fieldLable,
                                                 java.lang.String value)
                                          throws java.lang.Exception
        Throws:
        java.lang.Exception
      • switchToIframe

        @Then("^I switch to iframe with id or name (.+)$")
        public void switchToIframe​(java.lang.String iframe)
      • switchToParentIframe

        @Then("^I switch to parent iframe of multiple iframes$")
        public void switchToParentIframe()
      • switchToWindow

        @Then("^I switch to window with id or name or title (.+)$")
        public void switchToWindow​(java.lang.String windowName)
      • switchToWindowWithIndex

        @Then("^I switch to window with index (.+)$")
        public void switchToWindowWithIndex​(java.lang.String index)
      • switchToTab

        @Then("^I switch to tab$")
        public void switchToTab()
      • switchToParentWindow

        @Then("^I switch to parent window$")
        public void switchToParentWindow()
                                  throws java.lang.InterruptedException
        Throws:
        java.lang.InterruptedException
      • switchOutOfIframe

        @Then("^I switch out of iframe$")
        public void switchOutOfIframe()
      • acceptWebAlert

        @Then("^I accept web alert$")
        public void acceptWebAlert()
      • getPageSource

        @When("I get page source")
        public void getPageSource()
      • dismissWebAlert

        @Then("^I dismiss web alert$")
        public void dismissWebAlert()
      • pressEnterKey

        @Then("^I press enter key on element (.+)$")
        public void pressEnterKey​(java.lang.String locatorPath)
                           throws java.lang.Exception
        Throws:
        java.lang.Exception
      • pressTabKey

        @Then("^I press tab key on element (.+)$")
        public void pressTabKey​(java.lang.String locatorPath)
                         throws java.lang.Exception
        Throws:
        java.lang.Exception
      • pressEscapeKey

        @Then("^I press escape key on element (.+)$")
        public void pressEscapeKey​(java.lang.String locatorPath)
                            throws java.lang.Exception
        Throws:
        java.lang.Exception
      • encryptPasssword

        @Then("^I encrypt my plain text password (.+)$")
        public void encryptPasssword​(java.lang.String password)
      • doubleClick

        @Then("^I double click on an element (.+)$")
        public void doubleClick​(java.lang.String locatorPath)
                         throws java.lang.Exception
        Throws:
        java.lang.Exception
      • scrollTo

        @Then("^I scroll to element (.+)$")
        public void scrollTo​(java.lang.String locatorPath)
                      throws java.lang.Exception
        Throws:
        java.lang.Exception
      • scrollToTop

        @Then("^I scroll to top area of element (.+)$")
        public void scrollToTop​(java.lang.String locatorPath)
                         throws java.lang.Exception
        Throws:
        java.lang.Exception
      • scrollToBottom

        @Then("^I scroll to bottom area of element (.+)$")
        public void scrollToBottom​(java.lang.String locatorPath)
                            throws java.lang.Exception
        Throws:
        java.lang.Exception
      • takeScreenshot

        @Then("Screenshot - I take screenshot of current Page")
        public void takeScreenshot()
                            throws java.lang.Exception
        Throws:
        java.lang.Exception
      • i_click_element_locator

        @When("^I click element with locator (.+)$")
        public void i_click_element_locator​(java.lang.String locatorPath)
                                     throws java.lang.Exception
        Throws:
        java.lang.Exception
      • i_tap_element_locator

        @When("^AndroidBrowser - I click element with locator (.+)$")
        public void i_tap_element_locator​(java.lang.String locatorPath)
                                   throws java.lang.Exception
        Throws:
        java.lang.Exception
      • i_hover_mouse_on_element_locator

        @When("^I hover mouse on element with locator (.+)$")
        public void i_hover_mouse_on_element_locator​(java.lang.String locatorPath)
                                              throws java.lang.Exception
        Throws:
        java.lang.Exception
      • i_fill_input_locator_data

        @When("^I fill input with locator (.+) with data (.+)$")
        public void i_fill_input_locator_data​(java.lang.String locatorPath,
                                              java.lang.String dataPath)
                                       throws java.lang.Exception
        Throws:
        java.lang.Exception
      • get_attribute_data

        @When("^I get value of attribute (.+) from element (.+)$")
        public void get_attribute_data​(java.lang.String attribute,
                                       java.lang.String locatorPath)
                                throws java.lang.Exception
        Throws:
        java.lang.Exception
      • i_fill_id_with_value

        @When("^JS-I fill id (.+) with value (.+)$")
        public void i_fill_id_with_value​(java.lang.String id,
                                         java.lang.String value)
                                  throws java.lang.Exception
        Throws:
        java.lang.Exception
      • i_click_element

        @When("^I click element (.+)$")
        public void i_click_element​(java.lang.String locatorPath)
                             throws java.lang.Exception
        Clicks element of specified locator.
        Parameters:
        locatorPath -
        Throws:
        java.lang.Exception
      • i_check_element_locator_enabled

        @When("^I check element with locator (.+) is enabled$")
        public void i_check_element_locator_enabled​(java.lang.String locatorPath)
                                             throws java.lang.Exception
        Throws:
        java.lang.Exception
      • i_click_element_xpath

        @When("^I check element with xpath (.+)$")
        public void i_click_element_xpath​(java.lang.String xpath)
                                   throws java.lang.Exception
        Throws:
        java.lang.Exception
      • i_check_count_of_elements

        @When("^I check count of elements (.+) is (.+)$")
        public void i_check_count_of_elements​(java.lang.String locatorPath,
                                              int count)
                                       throws java.lang.Exception
        Throws:
        java.lang.Exception
      • i_check_count_of_elements_time

        @When("^For a duration - I check total count of elements (.+) test is (.+)$")
        public void i_check_count_of_elements_time​(java.lang.String locatorPath,
                                                   int count)
                                            throws java.lang.Exception
        Throws:
        java.lang.Exception
      • i_click_element_if_two_elements_equal

        @When("^If element with locator (.+) is the same as element with locator (.+) then I click element with locator (.+)$")
        public void i_click_element_if_two_elements_equal​(java.lang.String locatorPath1,
                                                          java.lang.String locatorPath2,
                                                          java.lang.String locatorPath3)
                                                   throws java.lang.Exception
        Throws:
        java.lang.Exception
      • i_fill_via_random_value_Mobile

        @When("^I fill element (.+) with random email alias (.+) with domain (.+)")
        public void i_fill_via_random_value_Mobile​(java.lang.String locatorPath,
                                                   java.lang.String alias,
                                                   java.lang.String emailDomain)
                                            throws java.lang.Exception
        Throws:
        java.lang.Exception
      • PrintStackTrace

        public java.lang.String PrintStackTrace​(java.lang.String error)
      • i_go_to_url

        @When("^I go to URL (.+)$")
        public void i_go_to_url​(java.lang.String url)
                         throws java.lang.Exception
        Throws:
        java.lang.Exception
      • if_alert_visible_accept_alert

        @When("if visible I accept alert")
        public void if_alert_visible_accept_alert()
      • i_click_element_if_visible

        @When("^I click element (.+) if visible$")
        public void i_click_element_if_visible​(java.lang.String locatorPath)
                                        throws java.io.IOException
        Throws:
        java.io.IOException
      • test

        @When("^Test$")
        public void test()
                  throws java.lang.Exception
        Throws:
        java.lang.Exception
      • wait

        @When("^I wait for (.+) seconds$")
        public void wait​(int seconds)
                  throws java.lang.Exception
        Throws:
        java.lang.Exception
      • I_set_property

        @When("^I set the property (.+) to (.+)$")
        public void I_set_property​(java.lang.String property,
                                   java.lang.String value)
                            throws java.lang.Exception
        Throws:
        java.lang.Exception