This file contains hidden or 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 calculator.ios; | |
| import com.testobject.TestObjectResultWatcher; | |
| import io.appium.java_client.AppiumDriver; | |
| import io.appium.java_client.MobileElement; | |
| import io.appium.java_client.ios.IOSDriver; | |
| import org.junit.After; | |
| import org.junit.Before; | |
| import org.junit.Rule; | |
| import org.junit.Test; |
This file contains hidden or 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
| # install and load the RSelenium package | |
| install.packages("RSelenium") | |
| require(RSelenium) | |
| # connect to your selenium server | |
| driver <- remoteDriver(remoteServerAddr = "localhost", port = 4444, browserName = "firefox") | |
| # launch a browser and navigate to the page you want information from | |
| driver$open() | |
| driver$navigate("https://www.quora.com/How-do-you-use-R-via-Selenium-to-download-data-automatically/") |
This file contains hidden or 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
| import org.openqa.selenium.JavascriptExecutor; | |
| import org.openqa.selenium.WebDriver; | |
| import org.openqa.selenium.chrome.ChromeDriver; | |
| public class AddElementToPage | |
| { | |
| public static void main(String[] args) | |
| { | |
| String code = | |
| "body = document.querySelector('body');" + |
This file contains hidden or 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
| var assert = require("assert"); | |
| describe("tests with annotations", function() | |
| { | |
| it("should print the test name in a before hook", function() | |
| { | |
| assert(true); | |
| }); | |
| beforeEach("annotate before", function beforeEach() |
This file contains hidden or 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
| import org.junit.Test; | |
| public class JUnitThreadTest | |
| { | |
| public int count = 0; | |
| @Test | |
| public void test1() throws InterruptedException | |
| { | |
| count++; |
This file contains hidden or 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
| import org.testng.annotations.Test; | |
| public class TestNGThreadTest | |
| { | |
| public int count = 0; | |
| @Test | |
| public void test1() throws InterruptedException | |
| { | |
| count++; |
This file contains hidden or 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
| import org.testng.Assert; | |
| import org.openqa.selenium.chrome.ChromeOptions; | |
| import org.openqa.selenium.remote.RemoteWebDriver; | |
| import org.openqa.selenium.MutableCapabilities; | |
| import java.net.URL; | |
| public class SeleniumNewVersionTest | |
| { | |
| public static void main(String[] args) throws Exception |
This file contains hidden or 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
| import org.junit.Rule; | |
| import org.junit.Test; | |
| import org.junit.rules.TestName; | |
| import static org.junit.Assert.assertEquals; | |
| public class TestDataFromName | |
| { | |
| @Rule | |
| public TestName testName = new TestName(); |
This file contains hidden or 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
| import org.junit.After; | |
| import org.junit.Before; | |
| import org.junit.Rule; | |
| import org.junit.Test; | |
| import org.junit.rules.TestName; | |
| import org.openqa.selenium.MutableCapabilities; | |
| import org.openqa.selenium.chrome.ChromeOptions; | |
| import org.openqa.selenium.remote.RemoteWebDriver; | |
| import java.net.MalformedURLException; |