Selenium-Cucumber : Test-Case Verification Steps

About Sameer Sawant

I am postgraduate in computer science from pune university. Working as QA Engineer in an IT company.
This entry was posted in selenium-cucumber ruby. Bookmark the permalink.

5 Responses to Selenium-Cucumber : Test-Case Verification Steps

  1. Rojess Luo says:

    Hi @Sameer, How can I run js on custom_steps.rb
    Then (/^I scroll the page$/) do
    js = <<JS
    window.scrollTo(100,900);
    JS
    $driver.execute_script js
    end

    Like

    • Sameer Sawant says:

      simply use step in feature file as

      Then I scoll the page

      Like

      • Rojess Luo says:

        Hi Sameer, Thanks for your reply, but I add the scripts in custom_steps.rb, It prompt
        “syntax error, unexpected end-of-input, expecting tSTRING_CONTENT or tSTRING_DBEG or tSTRING_DVAR or tSTRING_END js = <<JS ^ (SyntaxError) “

        Like

      • Sameer Sawant says:

        Then (/^I scroll the page$/) do
        $driver.execute_script(“window.scrollTo(100,900);”)
        end

        This will work

        Like

  2. Rojess Luo says:

    Great Sameer! Thank you very much!

    Like

Leave a comment