Selenium-Cucumber : Test-Case Verification Steps

Advertisement

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 Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s