I am using rspec + spork + selenium webdriver to test my app. I don't know how to access my app from selenium(while running rspec) for eg what url should i type in driver.navigate.to to get access to my website?
Best regards
Artur
You can see what's going on by starting spork this way:
SELENIUM='true' spork
When you start your tests by:
rspec spec --drb
Then the browser will open and you can see your test.
Related
I am a student and I started writing my first scripts using Ruby, Capybara, rspec and selenium web driver.
I need to run my script in all modern browsers, but I'm facing some problems to run my script at the new Microsoft browser Edge.
My rspec config is something like this:
Capybara.configure do |config|
config.default_driver = :selenium #This line is for run tests using Mozilla Firefox
#config.default_driver = :selenium_chrome #This line is for run tests using Google Chrome
end
Edge is just a fork of Chromium project, so... Is it possible this browser in my tests?
To use chrome based Edge with selenium You need to be using the latest selenium-webdriver 4.x alpha release. Then you'd need to register your own driver specifying the relevant options and browser as :edge_chrome. The necessary driver registration would be similar to the one Capybara provides for Chrome - https://github.com/teamcapybara/capybara/blob/master/lib/capybara/registrations/drivers.rb#L18
I am using Hound (https://github.com/HashNuke/hound) for integration testing a Phoenix application. I have chrome and chrome headless working. To get it working I have another terminal window running chromedriver (installed via brew). This feels odd to me. Is there a library or test setup that would feel more "integrated" into the application? What's the Elixir way of doing this?
In the Ruby world there's the webdrivers gem (https://github.com/titusfortner/webdrivers). As far as I know it downloads a specified driver (lets say chromedriver) to $HOME. Then with every test run, the test uses the driver downloaded to that destination to execute the tests.
Before the webdrivers gem there was chromedriver-helper gem. Before that it was phantomjs. These implementations made it so running integration tests required 1: downloading the driver 2: running the test
In Elixir (with Hound) I have my tests working by first running chromedriver --verbose in a terminal split, and in the other screen I run mix test. This works fine but feels disjointed. This adds extra steps, 1: download the driver 2: start the driver 3: run the test 4: stop driver
I could write a script manually to run chromedriver in the background, and stop it after the tests are run.
I am new to the Elixir community and so I've researched a lot. It's still not clear to me if there is a "traveled path" I should go down vs just hooking everything up manually.
Have I missed a recommended abstraction? Is this intentional? Is this "just not created, yet"?
Thank you
Have you checked out wallaby? See https://github.com/keathley/wallaby
The project I'm trying to do uses watir-webdriver and selenium-webdriver and phantomjs to write tests. And these tests go green while internet is not connected, but when internet is connected ,it gives a net:timeout error. What could be the possible reasons?
I have a large suite of Jasmine unit tests that were developed to run on a Selenium Grid using the jasmine:ci rake task provided by the Jasmine 1.3 Ruby gem. There was decent integration between Jasmine 1.3 and Selenium Webdriver and running tests on a remote node was as simple as passing some environment variables:
$ rake jasmine:ci SELENIUM_SERVER="http://hub.localdomain:4444/wd/hub" JASMINE_HOST="http://currenthost" JASMINE_BROWSER="chrome"
In Jasmine 2, this capability is gone, replaced by an integration with Phantomjs. Unfortunately, I can't find any discussion of migration options for people who still need Webdriver support.
Is there a way to run Jasmine 2 tests using Selenium Webdriver? Does anyone know of any existing projects or documentation focused on this integration? My query to the Jasmine dev list has gone unanswered.
On the jasmine team, it seemed to us that most people wanted to run their tests headless, so with 2.0 we made that the default. Running the tests in selenium also made the jasmine gem have a number of dependencies that potentially made it harder to install.
But we also see the value in running jasmine tests in multiple (real) browsers as well. To this end, we extracted the selenium code, including saucelabs integration, to it's own gem. Jasmine core actually uses this gem to runs it's own tests across multiple browsers.
I have several written automated tests in Ruby on Rails that run on Chrome using Chromedriver. I'd like to take those tests and start running them on IEdriver, but currently, when I start the tests, it opens in my local host and states that "This is the initial start page for the WebDriver server"
I've read that this is normal, but given that the first steps of the test is to navigate to our company website, I'm not sure what I need to do to selenium or to my tests to help it navigate to a valid website to start.
All good, it was zoom settings in the ie9 window.