WinAppDriver | executing .bat file - winappdriver

I am trying to execute .bat file using WinAppDriver. Everything is fine however, there are 2 sessions getting created.
Expected: Chrome browser must launch once and navigate to stackoverflow page only once
My java code snippet:
#BeforeClass
public static void setDesiredCapabilities() {
try {
System.out.println("Executing...");
DesiredCapabilities desiredCapabilities = new DesiredCapabilities();
desiredCapabilities.setCapability("app", "C:\Users\karan\Desktop\chrome.bat");
SkypeSession = new WindowsDriver(new URL("http://127.0.0.1:4723"), desiredCapabilities);
System.out.println("Is browsert?" +SkypeSession.isBrowser());
} catch (Exception ex) {
ex.printStackTrace();
}
}
My .bat opens chrome browser and navigates to stackoverflow
start "" http://www.stackoverflow.com
Below is error log generated by winAppDriver
POST /session HTTP/1.1
Accept-Encoding: gzip,deflate
Connection: Keep-Alive
Content-Length: 143
Content-Type: application/json; charset=utf-8
Host: 127.0.0.1:4723
User-Agent: Apache-HttpClient/4.5.2 (Java/1.8.0_131)
{"capabilities":[{"desiredCapabilities":{"app":"C:\Users\karan\Desktop\chrome.bat","platformName":"Windows"}},{"requiredCapabilities":{}}]}
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"}}
Actual: Chrome browser is launched once however, stackoverflow is launched twice in 2 adjacent tabs.
Please help.. thanks!

Try launching Chrome with Selenium ChromeDriver instead of WinAppDriver and a batch file. Please share the contents of your .bat file here.

Related

Jmeter: lots of Connection: close in response header

I am using Jmeter to do load testing against index page(static page) of my websit.
There are lots of errors in the test reulst because of connection closed.
Any tips why server(apache 2.2) decide to close the connection?
=============http headers===============
Load time:1055
Connect Time: 845
Latency: 1055
Size in bytes:98
Body size in bytes: 0
GET https://mysite/index.html
GET data:
[no cookies]
Request Headers:
Connection: keep-alive
Content-Length: 0
Content-Type: text/plain; charset=ISO-8859-1
Host: mysite
User-Agent: Apache-HttpClient/4.5.2 (Java/1.8.0_121)
Response headers:
HTTP/1.0 302 Found
Location: http://mysite/splash.html
Connection: close
Check your Mysql database connection pool size, During the load test you create number of thread it may insufficient to your mysql connection configuration.
you can increase max_connections in my.cnf
Try out the following JMeter configuration amendment:
Change "Implementation" of all your HTTP Request samplers to HttpClient4. The fastest and the easiest way of doing this for all the samplers is using HTTP Request Defaults
Add the next line to user.properties file (located in the "bin" folder of your JMeter installation)
httpclient4.retrycount=1
hc.parameters.file=hc.parameters
In the hc.parameters file add the next line:
http.connection.stalecheck$Boolean=true
Restart JMeter to pick the properties up
More information: Connection Reset since JMeter 2.10 ?

G-WAN v7.12.6 can't visit the static contents

G-WAN out-of-box is running no problem with the dynamic contents but can't visit the static contents.
I ran G-WAN with kk user(not root, no sudo). All files and directories are of kk user/group.
I installed it in localhost. When I typed 127.0.0.1:8080 in the browser, it returned:
Server not found
Firefox can't find the server at www.index.html.
It is strange that the returned server name was www.index.html
When I typed 127.0.0.1:8080/index.html, it returned 404 file not found.
How can I workaround these, until a new release is out?
This time, there is no error message in the log file.
(I installed G-WAN in Ubuntu 15.10)
UPDATE: ------------------------
There are two strange info from the served_from.c, as below:
This page was processed...
Using get_env():
by the Server: 0.0.0.0:8080:8080(hostname: 127.0.0.1)
^^^^^^^^^^^^^^^^^(Should it be only one '8080'?)
Virtual Host: /home/kk/dev/gwan_v7.12.6/0.0.0.0:8080/#0.0.0.0
HTTP method: GET
HTTP request: /?served_from
HTTP query: served_from
HTTP entity: (null)
Content-Encoding: 0
Content-Length: 0
Content-Type: 0
for the Client: 127.0.0.1:43199
Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:47.0) Gecko/20100101 Firefox/47.0
Using HTTP Headers to get the same information:
by the Server: 27.0.0.1:8080 (hostname: 27.0.0.1)
^^^^^^^^^^^^^(Should it be 127.0.0.1 ?
The leading '1' is missing.)
HTTP method: GET
HTTP entity: -
Content-Encoding: 0
Content-Length: 0
Content-Type: 0
for the Client: 127.0.0.1:43199
ozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:47.0) Gecko/20100101 Firefox/47.0
Acpt-Language: n-US,en;q=0.5
Acpt-Encoding: 3: |GZIP|DEFLATE
Cookies: -
Is there anything wrong in v7.12.6?
UPDATE 2 ================================
with the following steps, G-WAN v7.12.6 can't show static contents:
1. all files and directories are of the same user/group (i.e. kk)
2. out-of-box, listen to 8080
3. run ./gwan
cannot visit static contents.
with following changes, G-WAN works normally:
1. change directory 0.0.0.0.8080 to 0.0.0.0:80
2. run sudo ./gwan -d:kk:kk
everything is normal.
sorry for my mis-typing in the UPDATE2. It should be 0.0.0.0:80 (emphasize the colon). Actually, I typed it right in the directory name. Repeat: ./gwan should work according to G-WAN's document, since the user launching the program is owning all the files and directories.
If you can query the server for scripts then G-WAN is running fine. The problem is obviously a file permission issue, hence the error 404 file not found you got for the query 127.0.0.1:8080/index.html.
This system configuration problem will affect any program, not specifically G-WAN. Consult our dedicated FAQ to find how to correct it.
For the served_from.c script, feel free to display the IP address in the "correct" order and to cut the string at the expected position to avoid the listener port repetition.
UPDATE:
Your latest update says "changing directory 0.0.0.0.8080 to 0.0.0.0:80 works". This was the problem: "0.0.0.0.8080" has never been a valid syntax for G-WAN.

New cluster creation using Cloudera Director

Getting the following error while trying to create a new cluster using Cloudera Director. Any advice?
[ec2-user#ip-10-0-2-227 cloudera-director-1.0.0]$ ./bin/cloudera-director bootstrap-remote aws.reference.conf --lp.remote.hostAndPort=127.0.0.1:7189
Process logs can be found at /home/ec2-user/cloudera/cloudera-director-1.0.0/logs/application.log
Cloudera Director 1.0.0 initializing ...
Configuration file passes all validation checks.
Creating a new environment ...
>> POST http://127.0.0.1:7189/api/v1/environments
<< 401 Unauthorized
Unexpected internal error (see logs): HTTP/1.1 401 Unauthorized [X-Content-Type-Options: nosniff, X-XSS-Protection: 1; mode=block, Pragma: no-cache, X-Frame-Options: DENY, Set-Cookie: JSESSIONID=j0ii441ungs61o1ivobib7zn2;Path=/, Content-Type: application/json;charset=UTF-8, Transfer-Encoding: chunked, Server: Jetty(8.1.15.v20140411)]
You are using the Cloudera Director Server (which currently has known issues). In the meantime, you can still get the cluster running with Cloudera Director without the server part.
The command is
./bin/cloudera-director bootstrap aws.simple.conf (simple config)
-OR-
./bin/cloudera-director bootstrap aws.reference.conf (advanced config)
You need to supply the username and password for the Director server when using the bootstrap-remote command, for example:
... --lp.remote.username=admin --lp.remote.password=admin ...
This should have been included in our docs; we're working on that. (I work for Cloudera.)
Feel free to also post questions to community.cloudera.com.

How to subscribe to the PubSubHubbub github?

I'm currently attempting to write a basic client that listens to events from (enterprise) github, and makes API calls accordingly.
The problem I have is that I can't manage to get the PubSubHubbub client configured. I thought it was the client/authentication I'm using, but I now can't get the basic call from the docs working!
In an attempt to work out what I'm doing wrong, I'm making a curl request to my normal github account:
curl -u "joepym" -i \
https://api.github.com/hub \
-F "hub.mode=subscribe" \
-F "hub.topic=http://github.com/JoePym/faraday/events/push" \
-F "hub.callback=*callbackurl*"
and I'm getting back
HTTP/1.1 100 Continue
HTTP/1.1 422 Unprocessable Entity
Server: GitHub.com
Date: Wed, 08 May 2013 18:13:24 GMT
Content-Type: application/json; charset=utf-8
Connection: keep-alive
Status: 422 Unprocessable Entity
X-RateLimit-Limit: 5000
X-RateLimit-Remaining: 4989
X-GitHub-Media-Type: github.beta
X-Content-Type-Options: nosniff
Content-Length: 38
{
"message": "Invalid event: nil"
}
This invalid event message is what my main client is also getting when I attempt to call my enterprise github account with enterprise credentials.
Has anyone encountered this before?
Try using https://github.com/JoePym/faraday/events/push as your hub.topic. Note that we are now using 'https'.

my https website can't download by WGET command

I can browse the page by browser, but I can't download the html page by wget.
https://money.benck.tw
When I use wget, it can't even connect to the website:
--2011-10-12 05:30:24-- https://money.benck.tw/
Resolving money.benck.tw... 97.107.135.68
Connecting to money.benck.tw|97.107.135.68|:443... failed: Connection timed out.
Retrying.
--2011-10-12 05:33:35-- (try: 2) https://money.benck.tw/
Connecting to money.benck.tw|97.107.135.68|:443...
However, I can download the other https website like: https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js
It's very weird.
For this website you have to use the --no-check-certificate command
wget --no-check-certificate https://money.benck.tw
I'm experiments the same issue, I trying to download files from an external site like https://downloads.wordpress.org/plugin/easy-wp-smtp.zip and I wget using --no-check-certificate stills not working.... It's freezing in this line:
Connecting to downloads.wordpress.org (downloads.wordpress.org)|198.143.164.250|:443...
Anyone have the same issue?
No IP tables configured and rules. When I do this on other server on the same networks works fine. This only happens on this server specialy.
Regards,
Francisco Yu
This is because of this page is probably scraped by wget too often. You need to modify headers, especially useragent.
Examples from other website:
--no-check-certificate does not hepls
wget --no-check-certificate "https://www.money.pl/pieniadze/depozyty/walutowearch/1921-02-05,2021-02-05,LIBORCHF3M,strona,1.html" --2021-02-05 17:05:34-- https://www.money.pl/pieniadze/depozyty/walutowearch/1921-02-05,2021-02-05,LIBORCHF3M,strona,1.html
Loaded CA certificate '/etc/ssl/certs/ca-certificates.crt'
Resolving www.money.pl (www.money.pl)... 212.77.101.20
Connecting to www.money.pl (www.money.pl)|212.77.101.20|:443... connected.
HTTP request sent, awaiting response... 403 Forbidden
2021-02-05 17:05:34 ERROR 403: Forbidden.
but other tool to download sendign other headers works
http -h "https://www.money.pl/pieniadze/depozyty/walutowearch/1921-02-05,2021-02-05,LIBORCHF3M,strona,1.html"
HTTP/1.1 200 OK
Cache-control: max-age=60, public,stale-while-revalidate=5
Connection: keep-alive
Content-Encoding: gzip
Content-Length: 20756
Content-Security-Policy: upgrade-insecure-requests;
Content-Type: text/html; charset=iso-8859-2
Date: Fri, 05 Feb 2021 16:04:16 GMT
Link: <https://money.wp.pl/dGxwOTV0SyYZFTlneUtGM1pNbSY9EkhlJ1V1dglvOxgnKBALCW87GCcoEAsJbzsYJygQCwlvOxgnKBALCW87GCcoEAsJbzsYJygQCwlvOxgnKBALCW87GCcoEAsJbzsYJygQCwlvOxgnKBALCW87GCcoEAsJbzsYJygQCwlvOxgnKBALCW87GCcobXh0RUZ9WlgoNTAeDjRHBTlpZxYWIhMeKydrAld1TER2ciZYECoUSjgjIR4JKBYSNnomXEF1TUUJJD9VCi4ZEzUxcwJRdT4TKiQ5Sh0zAVJ9YWR2EyYUAjs7IVUFNRsfamZjAiJ2QUV-eWYCSXdNUn1hZHNWd0pGYmRkHVRyXUV6ZhV8LQU3JQwcEAMpYkpCfRclRBYoFhZqZmMCJ3ZWHzs5OhY0EDkoLjA0VFl1XgQ_PTgNKRMbQgIuB0lCIRQEOzUiWQB6XhYrIgVcCzMLSn9lZhYHJBkDKjM5Qh16DxYjISJJRjo=>;rel="preload";as="script";
Server: nginx
Set-Cookie: mny_ver2=v8c;Domain=.money.pl;Path=/;Max-Age=2592000;
Vary: Accept-Encoding

Resources