Appium Inspector Specify either app or appTopLevelWindow to create a session - appium

{
"platformName": "windows",
"appium:automationName": "windows",
"appium:appTopLevelWindow": "2f0c10"
}
This doesn't work with described error. But the same works on C#
I don't have app package or Id, only location of exe and this appTopLevelWindow.
I would like to attach the session with inspector. Can anybody help?
WinAppDriver log:
POST /session HTTP/1.1
Accept: application/json
Accept-Encoding: gzip, deflate, br
Accept-Language: en-US
Connection: keep-alive
Content-Length: 406
Content-Type: application/json
Host: 127.0.0.1:4723
Sec-Fetch-Dest: empty
Sec-Fetch-Mode: cors
Sec-Fetch-Site: cross-site
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) appium-inspector/2022.2.1 Chrome/91.0.4472.164 Electron/13.6.3 Safari/537.36
{"capabilities":{"alwaysMatch":{"platformName":"windows","appium:automationName":"windows","appium:appTopLevelWindow":"2f0c10","appium:newCommandTimeout":3600,"appium:connectHardwareKeyboard":true},"firstMatch":[{}]},"desiredCapabilities":{"platformName":"windows","appium:automationName":"windows","appium:appTopLevelWindow":"2f0c10","appium:newCommandTimeout":3600,"appium:connectHardwareKeyboard":true}}
HTTP/1.1 400 Bad Request
Content-Length: 141
Content-Type: application/json
{"status":100,"value":{"error":"invalid argument","message":"Bad capabilities. Specify either app or appTopLevelWindow to create a session"}}

It is working fine with the following dependency version:
io.appium : 7.3.0
selenium-java: 3.141.0

Related

Delete OPTIONS call fails when url contains %00(http://localhost:5432/rest/delete/author/my%00author)

When the url contains %00 the OPTIONS request failed with 400 Bad request. But if it is present in query parameters like ?name=my%00test then OPTIONS request returns 200 OK. Below is the Request and Response headers for that OPTIONS call.
Request Headers:
-----------------
OPTIONS /rest/api/books/test%00test HTTP/1.1
Host: localhost:8080
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Firefox/78.0
Accept: */*
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Access-Control-Request-Method: DELETE
Access-Control-Request-Headers: content-type
Referer: http://localhost:5432/
Origin: http://localhost:5432
Connection: keep-alive
Response Headers:
-----------------
HTTP/1.1 400
Content-Type: text/html;charset=utf-8
Content-Language: en
Content-Length: 795
Date: Sat, 20 Mar 2021 09:57:30 GMT
Connection: close

How to add a value to request HEAD

When calling GET method, user defined value is not added to HEAD
import 'dart:html';
import 'package:http/http.dart' as http;
void main() async {
var url = 'https://dev";
var res = await http.get(
url,
headers: {'X-Api-Key': 'xxxxxx'},
);
print(res.body);
}
I expect the output of
Host: a.com
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:69.0)
Gecko/20100101 Firefox/69.0
Accept: */*
Accept-Language: ko-KR,ko;q=0.8,en-US;q=0.5,en;q=0.3
Accept-Encoding: gzip, deflate, br
Access-Control-Request-Method: GET
Access-Control-Request-Headers: x-api-key
Referer: http://localhost:8080/
Origin: http://localhost:8080
DNT: 1
Connection: keep-alive
X-Api-Key: xxxxxx
Pragma: no-cache
Cache-Control: no-cache
TE: Trailers
(firefox request header)
but the actual output is
Host: a.com
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:69.0)
Gecko/20100101 Firefox/69.0
Accept: */*
Accept-Language: ko-KR,ko;q=0.8,en-US;q=0.5,en;q=0.3
Accept-Encoding: gzip, deflate, br
Access-Control-Request-Method: GET
Access-Control-Request-Headers: x-api-key
Referer: http://localhost:8080/
Origin: http://localhost:8080
DNT: 1
Connection: keep-alive
(firefox request header)

Jenkins doesn't find fonts for phpDocumentor

I have a problem with Jenkins and phpDocumentor. After a successful build, I want to open the documentation. Everything works fine except the icons, which are displayed as squares. A short look in the developer tools shows this error message:
Request:
GET /job/PROJECTNAME/javadoc/font/fontawesome-webfont.woff?v=3.2.1 HTTP/1.1
Host: URLTOJENKINS
Connection: keep-alive
Cache-Control: no-cache
Pragma: no-cache
User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/36.0.1985.125 Safari/537.36
Accept: /
Referer: http://URLTOJENKINS.com/job/PROJECTNAME/javadoc/namespaces/SOMEPAGE.html
Accept-Encoding: gzip,deflate,sdch
Accept-Language: de-DE,de;q=0.8,en-US;q=0.6,en;q=0.4
Response:
HTTP/1.1 404 Not Found
Content-Type: text/html;charset=ISO-8859-1
Cache-Control: must-revalidate,no-cache,no-store
Content-Length: 1410
Server: Jetty(8.y.z-SNAPSHOT)

Yandex tank post data

I want to use yandex tank to test my web app, I want to test registration, so i need to send request like this
Header
POST /registration HTTP/1.1
Host: localhost:8080
Connection: keep-alive
Content-Length: 30
Cache-Control: max-age=0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
Origin: http://localhost:8080
User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1750.146 Safari/537.36
Content-Type: application/x-www-form-urlencoded
Referer: http://localhost:8080/registration
Accept-Encoding: gzip,deflate,sdch
Accept-Language: en-US,en;q=0.8,ru;q=0.6
Cookie: csrftoken=XJ3oheJb0SndHfNAH2lSV2AtKNxxuXdv; JSESSIONID=igq9ejgl10jirr4t73mpjblp
Form Data
login=abracadbra&password=brar
Is it possible to send that kind of requests with different login fields?
Yes, it's possible, for POST requests your should use request-style ammo file, see http://yandextank.readthedocs.org/en/latest/tutorial.html#request-style
You may specify ammo file as command line parameter or put it in tank .ini file in [phantom] section.
Remember that with phantom as load-generator it's not possible to perform scenario-based testing, so you should generate all necessary data for requests in advance. Yandex-tank will just send it according to desired load-scheme.
I'm not sure how CSRF protection works in your case, and if it does not permit re-use of session and csrftoken for multiple requests (and this parameters are mandatory for registration requests), you'll need to somehow obtain valid Cookies for each request to generate ammo. In this case I'd recommend you to switch to some scenario-based tool, i.e. jmeter. You may use jmeter as load-generator for yandex-tank as well, see http://yandextank.readthedocs.org/en/latest/configuration.html#jmeter
In case you may reuse same Cookie for multiple registrations, ammo file will be like that:
649 tag1
POST /registration HTTP/1.1
Host: localhost:8080
Connection: keep-alive
Content-Length: 30
Cache-Control: max-age=0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
Origin: http://localhost:8080
User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1750.146 Safari/537.36
Content-Type: application/x-www-form-urlencoded
Referer: http://localhost:8080/registration
Accept-Encoding: gzip,deflate,sdch
Accept-Language: en-US,en;q=0.8,ru;q=0.6
Cookie: csrftoken=XJ3oheJb0SndHfNAH2lSV2AtKNxxuXdv; JSESSIONID=igq9ejgl10jirr4t73mpjblp
login=abracadbra&password=brar
646 tag2
POST /registration HTTP/1.1
Host: localhost:8080
Connection: keep-alive
Content-Length: 27
Cache-Control: max-age=0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
Origin: http://localhost:8080
User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1750.146 Safari/537.36
Content-Type: application/x-www-form-urlencoded
Referer: http://localhost:8080/registration
Accept-Encoding: gzip,deflate,sdch
Accept-Language: en-US,en;q=0.8,ru;q=0.6
Cookie: csrftoken=XJ3oheJb0SndHfNAH2lSV2AtKNxxuXdv; JSESSIONID=igq9ejgl10jirr4t73mpjblp
login=sample2&password=brar
...
There is also URI+POST format similar to uri-style, but with post bodies:
load.ini:
ammo_type=uripost
ammo.uripost:
[Host: example.org]
[Connection: close]
[User-Agent: Tank]
5 /route/?rll=50.262025%2C53.276083~50.056015%2C53.495561&origin=1&simplify=1
class
10 /route/?rll=50.262025%2C53.276083~50.056015%2C53.495561&origin=1&simplify=1
hello!clas
7 /route/?rll=37.565147%2C55.695758~37.412796%2C55.691454&origin=1&simplify=1
uripost
Numbers at the beginnings of lines with uris are sizes of post bodies.

Siege does not send POST data

I'm trying to test my site with siege 3.0.1. But it seems that siege does not send POST data. Here is a request I get from web-browser
POST / HTTP/1.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Encoding: gzip,deflate,sdch
Accept-Language: en-US,en;q=0.8
Cache-Control: no-cache
Content-Length: 130
Content-Type: application/x-www-form-urlencoded
Host: rsc
Origin: http://rsc
Pragma: no-cache
Referer: http://rsc/
User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/28.0.1500.52 Safari/537.36
X-Forwarded-For: 127.0.0.1
X-Forwarded-Proto: http
X-Real-Ip: 127.0.0.1
came_from=http%3A%2F%2Frsc%2F&login=***&password=***&form.login=%D0%9E%D1%82%D0%BF%D1%80%D0%B0%D0%B2%D0%B8%D1%82%D1%8C
And here a request from siege
siege -g "http://rsc/ POST came_from=http%3A%2F%2Frsc%2F&login=***&password=***&form.login=%D0%9E%D1%82%D0%BF%D1%80%D0%B0%D0%B2%D0%B8%D1%82%D1%8C"
POST / HTTP/1.0
Accept: */*
Accept-Encoding:
Content-Length: 111
Content-Type: application/x-www-form-urlencoded
Host: rsc
User-Agent: JoeDog/1.00 [en] (X11; I; Siege 3.0.1)
X-Forwarded-For: 127.0.0.1
X-Forwarded-Proto: http
X-Real-Ip: 127.0.0.1
Am I doing something wrong? I checked siege documentation and it says nothing about POST except I should write POST my=params after url.
According to the Siege home page, 3.0.1 has a major bug with HTTP POST and the author suggests upgrading to 3.0.2
I had a similar problem - siege would not post, however the result was a "200" and then a "General Error". I tried everything, the end result: I rolled back to a previous version of 2.7.2 from 3.0.1 and it mysteriously works. Fyi.

Resources