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
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE suite SYSTEM "https://testng.org/testng-1.0.dtd"> | |
<!-- 1. --> | |
<suite name="Mobile Suite" verbose="2"> | |
<!-- 2. --> | |
<test name="Test iOS App on LambdaTest"> | |
<parameter name="environment" value="CLOUD"/> | |
<parameter name="deviceName" value="iPhone 13 Pro"/> | |
<parameter name="version" value="15"/> | |
<parameter name="app" value="LT_APP_IOS"/> |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xmlns="http://maven.apache.org/POM/4.0.0" | |
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | |
<modelVersion>4.0.0</modelVersion> | |
<groupId>com.lambdatest.appium.sample</groupId> | |
<artifactId>appium-lambdatest-sample</artifactId> | |
<version>1.0-SNAPSHOT</version> | |
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 com.lambdatest.appium.sample.utils; | |
import static io.appium.java_client.touch.WaitOptions.waitOptions; | |
import static io.appium.java_client.touch.offset.PointOption.point; | |
import static java.time.Duration.ofMillis; | |
import io.appium.java_client.AppiumDriver; | |
import io.appium.java_client.MobileElement; | |
import io.appium.java_client.TouchAction; | |
import io.appium.java_client.touch.offset.PointOption; |
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 com.lambdatest.appium.sample.pages; | |
import java.util.Map; | |
import com.google.common.collect.ImmutableMap; | |
import com.lambdatest.appium.sample.enums.Platform; | |
import io.appium.java_client.MobileBy; | |
import org.openqa.selenium.By; | |
public class HomePage { |
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
app.get('/', async (request, response) => { | |
// Web Scraping Code here | |
try { | |
const data = await WebScrapingLocalTest(); | |
response.status(200).json(data); | |
} catch (error) { | |
response.status(500).json({ | |
message: 'Server error occurred', | |
}); | |
} |
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
```js | |
app.get('/', async (request, response) => { | |
// Web Scraping Code here | |
try { | |
const data = await WebScrapingLocalTest(); | |
response.status(200).json(data); | |
} catch (error) { | |
response.status(500).json({ | |
message: 'Server error occurred', |
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
async function getVideos(videos) { | |
let videoDetails = []; | |
try { | |
for (const video of videos) { | |
const title = await video.findElement(By.id('video-title')).getText(); | |
const views = await video | |
.findElement(By.xpath(".//*[@id='metadata-line']/span[1]")) | |
.getText(); | |
const date = await video | |
.findElement(By.xpath(".//*[@id='metadata-line']/span[2]")) |
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
const express = require('express'); | |
const { Builder, By } = require('selenium-webdriver'); | |
const app = express(); | |
const port = 3000; | |
app.get('/', async (request, response) => { | |
// Web Scraping Code here | |
try { | |
const data = await WebScrapingLocalTest(); | |
response.status(200).json(data); |
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 pytest | |
from selenium import webdriver | |
import sys | |
from selenium.webdriver.common.by import By | |
from selenium.common.exceptions import StaleElementReferenceException | |
ch_capabilities = { | |
'LT:Options' : { | |
"user" : "<username>", |
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 pytest | |
from selenium import webdriver | |
import sys | |
from selenium.webdriver.common.by import By | |
from selenium.common.exceptions import StaleElementReferenceException | |
# Desired Capabilities according to SELENIUM 4 | |
ff_capabilities = { | |
'LT:Options' : { | |
"user" : "<username>", |