This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'capybara' | |
require 'capybara/dsl' | |
require 'browsermob/proxy' | |
require 'selenium-webdriver' | |
include Capybara::DSL | |
# Download browsermob-proxy. | |
# Set JAVA_HOME for browsermob proxy |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
=Create driver= | |
include Capybara::DSL | |
Capybara.run_server = false | |
Capybara.register_driver :chrome do |app| | |
Capybara::Selenium::Driver.new(app, browser: :chrome) | |
end | |
Capybara.default_driver = :chrome | |
Capybara.app_host = "http://demoapp.strongqa.com" | |
=Resize Browser= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package test; | |
import org.openqa.selenium.By; | |
import org.testng.annotations.*; | |
import utilits.TestBase; | |
import static com.codeborne.selenide.Selenide.$; | |
import static com.codeborne.selenide.Condition.text; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
=Navigating= | |
baseUrl = "http://site.com"; | |
open("/login"); | |
open("http://google.com"); | |
switchTo().frame($("#myFrame").toWebElement()); | |
=Alert= | |
switchTo().alert().accept(); |