Is it playwright in Java language have option for remote debugging port? - remote-debugging

If we looked back to ChromeOption in Selenium WebDriver :
ChromeOptions chromeOptions = new ChromeOptions();
chromeOptions.setBinary("C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe");
chromeOptions.setExperimentalOption("debuggerAddress", "localhost:8003");
I don't have any documentation in playwright remote debugging especially in Java language.

Related

can't connect to Selenium server from vagrant machine

i built my first web project on a vagrant machine. I would like to run some browser tests with selenium. i have the tests (and rest of project) on virtual machine.
it appears that I can use selenium server standalone to connect to my local machine and run the browsers on the local machine.
On the local machine, I run the following: java -jar selenium-server-standalone-3.8.1.jar
I get a bunch of successful code including: osjs.AbstractConnector:main: Started ServerConnector#709a8be8{HTTP/1.1,[http/1.1]}{0.0.0.0:4444}
Presumably, that is where i can connect from my virtual machine.
I then have a small python script:
from selenium import webdriver
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities
driver = webdriver.Remote(
command_executor='http://0.0.0.0:4444',
desired_capabilities=DesiredCapabilities.CHROME)
driver.get("http://www.python.org")
I get the following error: urllib.error.URLError: <urlopen error [Errno 111] Connection refused>
I can't find much more detail on this process than these steps. If someone could help with this problem, I'd be grateful.
try
driver = webdriver.Remote(
command_executor='http://selenium-hub:4444/wd/hub',
desired_capabilities=DesiredCapabilities.CHROME)
driver.get("https://google.com")

How may i connect ruby on rails with sql server on windows

Want to use sql server as a database instead of mysql in Windows.What configuration i need to change in database.yml file and what all gems are needed for installation.Please help.
Sorry to disappoint you, but there are no easy solutions for using Rails on a Windows platform. It was not designed to run on Windows and I don't think I would recommend Windows as a platform for a Rails app. Not to say it hasn't been done, but in my experience it would be far easier to setup and run on a Linux platform as it was designed to do.
There is support for MS SQL server and Rails and you can checkout this project for more information.
My recommendation is to learn more about Rails and setting it up the environment, because a red flag to me is that you want to deploy a Rails app and yet do not know how to set it for production. This should be Rails 101 knowledge. Production is just another environment for Rails, there are things you need to be aware of when running a Rails app in production and this information can be found on easily rubyonrails.org.
Put some more time into learning Rails and perhaps setup a Linux virtual machine, deploy your Rails app, and experiment. Once you learn how to deploy Rails on a Linux platform them perhaps it may be a little easier to understand how to go about doing it on Windows.
please refer :-- https://github.com/rails-sqlserver/activerecord-sqlserver-adapter
Or else you can try with this
What is left is to learn is how to use database engine that is probably of the most interest for developers who work on Windows – Microsoft's SQL Server. If you do not have MS SQL Server installed go ahead and download MS SQL Server Express installer from Microsoft's site. I will use version 2014 in this book. Let's first create database that we will use in our Rails application:
osql -b -S localhost -U -P -Q "CREATE DATABASE RwinBookDevel COLLATE SQL_Latin1_General_CP1_CS_AS"
Newest rails adapter for MS SQL Server uses tiny_tds library to connect to MS SQL server and its usage is almost straigtforward. First thing we have to do is to add following two lines to Gemfile:
gem 'tiny_tds'
gem 'activerecord-sqlserver-adapter'
And run bundle install.
With all prerequisites met we can now configure our Ruby on Rails application to use SQL Server. Connection options are displayed below:
development:
adapter: sqlserver
mode: dblib
host: localhost
port: 1433
username: <your_db_user_name>
password: <your_db_password>
database: ABC
Hope this will help you......

Kivy osc running server and gui on Android simultaneous

I want to run a simulation server and a GUI that responds to the messages of- and influences the server through messages on Android with Kivy and osc.
Question
Basically my problem comes down to: I can't run both scripts at the same time. How do I do this?
The GUI: https://github.com/PdeRooij/DMAS/blob/GUI/main.py
The server: https://github.com/PdeRooij/DMAS/blob/GUI/service/main.py#L55-L114
Relevant code GUI:
def start_service(self):
if platform == 'android':
from android import AndroidService
service = AndroidService('Agent emergence service', 'running')
service.start('service started')
self.service = service
If I build it with buildozer, only the GUI runs. In Ubuntu I would just open 2 terminals and run: python model/main.py and python main.py. How can I also let model/main.py run in the android .apk?
I think I should do something with: def start_service(self):, but I don't know what. Also for some reason PyCharm underlines this in red: from android import AndroidService.
Example that didn't work for me on Android
https://github.com/tshirtman/kivy_service_osc
Specs
Python 2.7.6
Ubuntu 14.04
PPA: Kivy-daily
The problem lays in that AndroidService looks for service/main.py. So renaming the folder 'model' to 'service' did the trick.
Interesting to know is that the service doesn't need to have any Kivy code in it. 'from kivy.lib import osc' can be replaced for 'import osc' (which is copied from kivy, but all dependencies removed/replaced).
https://github.com/PdeRooij/DMAS/tree/GUI/service/osc

Does Selenium support headless browser testing?

I'm looking at Selenium Server at the moment, and I don't seem to notice a driver that supports headless browser testing.
Unless I'm mistaken, it doesn't support it. If you're on X, you can create a virtual framebuffer to hide the browser window, but that's not really a headless browser.
Can anyone enlighten me? Does Selenium support headless browser testing?
you need not use PhantomJS as an alternative to Selenium. Selenium includes a PhantomJS webdriver class, which rides on the GhostDriver platform. Simply install the PhantomJS binary to your machine. in python, you can then use:
from selenium import webdriver
dr = webdriver.PhantomJS()
and voila.
The WebDriver API has support for HTMLUnit as the browser for your testing. Ruby people have been using Capybara for a while for their headless selenium testing so it is definitely doable.
I know this is a old post. Thought it will help others who are looking for an answer.
You can install a full blown firefox in any linux distribution using XVFB. This makes sure your testing is performed in a real browser. Once you have a headless setup, you can use webdriver of your choice to connect and run testing.
Headless browsers are a bad idea. They get you some testing, but nothing like what a real user will see, and they mask lots of problems that only real browsers encounter. You're infinitely better off using a "headed" browser (i.e., anything but HTMLUnit) on a headless environment (e.g., Windows, or Linux with XVFB).
I notice that you say that using an X framebuffer isn't a true headless solution, however, for most, I think it would be acceptable. In addition to that, this service will help get that going for you if you are interested in that as a solution.
Selenium does support headless browser testing in a way. Docker Selenium is maintained by SeleniumHQ. Those docker containers come with xvfb support with them out of the box. There are tools like PhantomJS that you can hook up with Selenium. However, it's not officially supported by Selenium itself.
Much like what others have described, PhantomJS isn't really recommended. The whole point of Selenium is to automate browsers. But why automate a browser no one uses? I never understood how that was overlooked so often by developers..
Yes. Selenium support headless browser testing and it's more faster as well as convient for big amount of test-cases execution.
ChromeOptions cromeOptions = new ChromeOptions();
//Location of browser binary/.exe file
cromeOptions.setBinary("/usr/bin/google-chrome-stable");
cromeOptions.addArguments("--headless");
cromeOptions.addArguments("--no-sandbox");
cromeOptions.addArguments("--disable-gpu");
cromeOptions.addArguments("--window-size=1920,1080");
WebDriver webDriver = new ChromeDriver(cromeOptions);
Yes ,selenium supports headless browser testing...but i found HTMLUnit failing most times...I was searching for an alternative...PhantomJs was really good.you can definitely give it a try it was very fast when compared to other browsers...It is really good for smoke testing...
http://phantomjs.org/
With ruby and macOS: brew install phantomjs then:
driver = Selenium::WebDriver.for :phantomjs
Yes Selenium supports headless browser testing.Headless browsers are faster than real time browsers.
Install chromeDriver and google-chrome-stable version on the linux server, where the tests will be triggered and add the same binaries in your code.
code snippet:
private static String driverPath = "/usr/bin/chromedriver";
static
{
System.setProperty("webdriver.chrome.driver", driverPath);
options = new ChromeOptions();
options.setBinary("/usr/bin/google-chrome-stable");
options.addArguments("headless");
driver = new ChromeDriver(options);
}
Here's a "modern answer" on how to use Selenium with xvfb and Firefox driver in an Ubuntu Linux environment running Django/Python:
# install xvfb and Firefox driver
sudo su
apt-get install -y xvfb firefox
wget https://github.com/mozilla/geckodriver/releases/download/v0.19.1/geckodriver-v0.19.1-linux64.tar.gz
tar -x geckodriver -zf geckodriver-v0.19.1-linux64.tar.gz -O >
/usr/bin/geckodriver
chmod +x /usr/bin/geckodriver
# install pip modules
pip install selenium
pip install PyVirtualDisplay
You can then follow the Django LiveServerTestCase instructions.
To use the driver you just installed, do something like this:
from pyvirtualdisplay import Display
from selenium.webdriver.firefox.webdriver import WebDriver
driver = WebDriver(executable_path='/usr/bin/geckodriver')
display = Display(visible=0, size=(800, 600)).start()
# add your testing classes here...
driver.quit()
display.stop()

Is there anything similar to Selenium IDE that would run on Internet Explorer 7?

I need to develop Web functional testing for an application that currently supports only IE 7+. I'd also like to have my tests exported in Java so that I can have them integrated with my Java codebase
You can record tests in Selenium IDE on Firefox and then export them to Java (File > Export Test Case As...). You can then using a testing framework such as JUnit or TestNG to run your tests with Selenium RC. To test in Internet Explorer 7, set your browser string to *iexplore (HTA mode) or *iexploreproxy and run the RC on a machine with version 7 installed.
Selenium RC can run on IE 7 and you can do more with it because you can write the tests in high-level languages like Java and Ruby.