I have a webdriverIO framework built. I am trying to setup a webdriverIO config file to connect to AWS Device Farm, and obtaining a mobile device, then running the appium based tests.
Maybe something like this? for the config file for iOS?
But the issue I have is the following:
How do I point to the IPA file that I have uploaded to the server?
How do I connect to the AWS Device Farm?
Is it safe to assume since AWS Device Farm runs an appium server, the supported capabilities is what I should use from appium?
const { join } = require('path');
const { config } = require('./wdio.conf');
config.specs = [
'./tests/specs/**/*.spec.js',
];
config.capabilities = [
{
platformName: 'iOS',
maxInstances: 1,
'appium:deviceName': 'iPhone 12',
'appium:platformVersion': '14.4',
'appium:orientation': 'PORTRAIT',
'appium:automationName': 'XCUITest',
'appium:app': 'replace this with your locally built app - full path to app file',
// 'appium:app': join(process.cwd(), './apps/iOS-Simulator-NativeDemoApp-0.2.1.app.zip'),
'appium:noReset': true,
'appium:newCommandTimeout': 240,
},
];
exports.config = config;
For these questions:
How do I point to the IPA file that I have uploaded to the server?
AWS Device Farm uses a server-side execution platform, where you upload your app and test code using the CreateUpload API (ref https://docs.aws.amazon.com/devicefarm/latest/APIReference/API_CreateUpload.html).
How do I connect to the AWS Device Farm?
You do not connect to AWS Device Farm from your local client, you Schedule a run on Device Farm using the ScheduleRun API (ref https://docs.aws.amazon.com/devicefarm/latest/APIReference/API_ScheduleRun.html)
Is it safe to assume since AWS Device Farm runs an appium server, the supported capabilities is what I should use from appium?
Yes, Device Farm executes your test on a server-side platform using an Appium server at localhost:4723
Please see this blog post for a detailed walk-through that should clarify some of these things for you: https://aws.amazon.com/blogs/mobile/testing-mobile-apps-with-cucumber-and-appium-through-testng-on-aws-device-farm/
Related
We have Jenkins server hosted in Linux server, and we want to trigger our selenium tests from Jenkins to different remote desktops (Windows) using selenium grid (Here, Jenkins, hub, and node all three are in different machines).
Note: We aren't allowed to host Selenium hub in the same machine where we have Jenkins or install any Selenium Grid plugin in Jenkins.
You can use remote driver. Here is simple example
options = webdriver.ChromeOptions()
driver = webdriver.Remote(command_executor='http://<your_windows_IP_ADDR>:4444/wd/hub', options=options)
It will be in your code, you will run Selenium Server(Grid) on your Windows device. Then you can configure any setup after that.
I'm trying to do automated tests on a localhost site using the following settings:
Python 3.8.10
selenium 3.141.0
Firefox 90.0
Burp Suite Community Edition v2021.6.2
I'm using Burp proxy with the address 127.0.0.1:8080.
I tested several examples available here. The below code is the one that has worked best so far.
from selenium import webdriver
firefox_capabilities = webdriver.DesiredCapabilities.FIREFOX
firefox_capabilities['marionette'] = True
PROXY = "127.0.0.1:8080"
firefox_capabilities['proxy'] = {
"proxyType": "MANUAL",
"httpProxy": PROXY,
"sslProxy": PROXY
}
driver = webdriver.Firefox(capabilities=firefox_capabilities)
driver.get("http://127.0.0.1")
This code works fine when the url in driver.get("URL here") is not localhost. When I enter the url http://127.0.0.1, the access made by selenium does not appear in Burp Suite's HTTP history. Instead of the accessed url, "http://detectportal.firefox.com" appears.
Is this a problem in the code or some configuration that I need to do?
Burp HTTP History
Look into the Firefox proxy settings, there you can find a statement that localhost connections are never directed to a proxy.
But this can be changed by opening about:config and set the option network.proxy.allow_hijacking_localhost to true.
For Burp to track links on localhost just add ("network.proxy.allow_hijacking_localhost", True) to FirefoxProfile().
from selenium import webdriver
fp = webdriver.FirefoxProfile()
fp.set_preference("network.proxy.type", 1)
fp.set_preference("network.proxy.http", "127.0.0.1")
fp.set_preference("network.proxy.http_port", 8080)
fp.set_preference("network.proxy.allow_hijacking_localhost", True)
fp.update_preferences()
driver = webdriver.Firefox(firefox_profile=fp)
driver.get('http://127.0.0.1')
I have a .NET Core 2.2 app using a PostgreSQL DB.
Now I want to deploy it on Google Cloud App Engine Flex and Google Cloud SQL PostgreSQL.
I tried the official way and found this, where I found that you have to use $ gcloud beta app deploy instead of $ gcloud app deploy
My app.yaml configuration file:
env: flex
runtime: aspnetcore
beta_settings:
cloud_sql_instances: "<SQL-NAME>=tcp:<PORT>"
The issue is that I get this error:
Trying to connect to
Host=127.0.0.1;Port=XXX;Username=XXX;Password=XXX;Database=XXX;
Application startup exception: System.Net.Sockets.SocketException
(111): Connection refused
Do I have to include special libraries into .NET Core 2.2 to support Google App Engine?
You don't need to include any special libraries in .NET Core 2.2 rather than those that are already included in the Quckstart that you have shared above, unless of course you are using any additional libraries in your code.
I have tried the quickstart and deployed my .NET GAE app that connects to CloudSQL PostgreSQL database.
Taking a look at your app.yaml configuration file I can see that there is an issue with it. Also based on the error message you are getting I assume that you are having an issue in your appsettings.json file as well.
Based on the quickstart of GitHub that you shared, the configuration when deploying should be:
app.yaml
runtime: aspnetcore
env: flex
beta_settings:
cloud_sql_instances: "[PROJECT_ID]:[INSTANCE_REGION]:[INSTANCE_NAME]=tcp:[TCP_PORT_NUMPER]"
TCP Port number for PostgreSQL: 5432
TCP Port number for MySQL: 3306
To find the Instance connection name which is the part before tcp, you can go to Cloud Console > SQL > [YOU_INSTANCE_NAME] and you can find the entire string under Instance connection name
appsettings.json
{
"CloudSQL" : {
"Database" : "PostgreSQL", // Set to "PostgreSQL" when using a PostgreSQL database.
// [START gae_flex_mysql_settings]
"ConnectionString": "Uid=[USER_ID];Pwd=[PASSWORD];Host=cloudsql;Database=[DATABASE_NAME]"
// [END gae_flex_mysql_settings]
}
}
Database should be PostgreSQL as also specified by the comment
ConnectionString should be filled with your own data that you used to setup the database
The Host part should be cloudsql when you are deploying and 127.0.0.1 when running locally.
127.0.0.1 indicates that the database is running locally and the cloudsql string indicates that it should use the connection string name. Based on the error, I assume that you used the 127.0.0.1 to test locally but then forgot to change it back when you were deploying.
I have a webapp running on a docker container whose port 443 is exposed and mapped to port 32770 on local host.
When I access the webapp on my linux host via:
1) https://container-ip : Web app runs fine without any issues.
2) https://localhost:32770 : Web app loads but is unable to communicate with middleware
(Middleware runs on container and maintains an sqlite DB and talks to app via websocket using port 9000)
Edit1:
Docker output:
fzkl#nemean-lx:~/repo/ams-emulator$ sudo docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
7ce281d8a66a atonlabemu_only_443 "./start.sh" 18 minutes ago Up 18 minutes 0.0.0.0:32771->443/tcp sleepy_lamport
1b6f03255d16 atonlabemu_only_443 "./start.sh" 6 hours ago Up 6 hours 0.0.0.0:32770->443/tcp unruffled_euler
I noticed that UI interaction when accessed via localhost:port doesn't register into the app logs.
Edit2:
# cat serverConfig.json
{
# private stuff
"secondaryMemoryPath":"/media/sdcard",
"port":{
"normal":9000,
"critical":9001,
"uiHost":443
}
}
On the middleware side, cfg file:
[websocket]
normal-communication-port=9000
critical-communication-port=9001
Any help on getting the webapp and middleware to communicate while accessing through localhost:port is much appreciated. Thanks!
In our development environment we have our Angular app running on a Mac in development mode (grunt serve)
From a browser on the Mac we can access it with http://localhost:9000/
How can we access it from IE on a VirtualBox?
We are using yo angular generator Gruntfile.js
connect: {
options: {
port: 9000,
// Change this to '0.0.0.0' to access the server from outside.
hostname: 'localhost',
livereload: 35729
},
UPDATE:
The VirtualBox is installed, with Windows and IE, on the same Mac where I "grunt serve" and develop the Angular app
I can access the angular app from IE within VBox using URL: http://10.0.2.2
But something is still not working
1) In the Network panel
request.Name: livereload.js?snipver=1
request.Path: http://10.0.2.2:35729/
request.Protocol: pending
request.Status (Description): pending
2) In the Network panel there are no XHR requests listed
Maybe the problem is that the app is using REST endpoints which are on another server which is accessed through VPN ?
SOLVED:
The problem was not with V-Box network setup but with the way I was detecting localhost in the angular app (for DEV purposes)
I had:
var IS_LOCALHOST = (location.hostname.indexOf('localhost') > -1)
I changed it to
var IS_LOCALHOST = (location.hostname.indexOf('localhost') > -1) || (location.hostname.indexOf('10.0.2.2') > -1);
I use it for things like
var BASE_URL = IS_LOCALHOST ? 'http://dev.api.base.url' : 'http://' + location.hostname;
Where is the Virtualbox hosted? I'm assuming it's running some version of Windows since you ask about IE.
If the Virtualbox is running on the same host (physical machine) as the Angular app, it sounds like you need to set the VM to "host-only" networking mode.
See this: https://superuser.com/questions/303906/virtualbox-make-host-and-guest-os-talk-between-each-other
Once you have networking between the host and guest machines, you should be able to launch IE in the Virtualbox and type the IP address of the Mac and the port (:9000) and connect.
Make sure Grunt Serve is set to serve outside of "localhost." See this: Access node.js/grunt server through localhost:port on virtual machine
Also, make sure there aren't any firewall rules to interfere with requests to port 9000 on your Mac.
You can go to virtualbox network adapter settings for the windows OS and bridge both the connections. This way you will be able to access the angular app inside IE by giving the IP address, port of mac.
http://IP_OF_MAC:Port