Dummy UI or how to run sikuli in headless mode - testing

I'm doing test automation when I faced a problem a digest authentication I'm using watir for my automation, watir couldn't access the alert window which demands username and password, watir with its browser.alert.set method can only access username field.
I found a solution in sikuli but it needs UI and I need to run this test case on server which doesn't have any UI,I'm using headless in watir test cases can I have something like headless browser in UI to run this test case, like a dummy UI or something or how to run sikuli in headless mode.
Or any solution on my other question How to enter password in a popup using watir?

All I know is here:
https://answers.launchpad.net/sikuli/+question/118598
I assume you need a view of the desktop, as Sikuli works visually recognizing objects, so there is no point running it in a headless environment.

I already use sikuli in headless mode.
Windows: see my answer.
Ubuntu: try Xvfb.

Related

MicrosoftWebDriver 16299, 15063 doesn't work when I minimise Edge browser window

When I execute tests using MicrosoftWebDriver for Edge all works fine, but when I minimise the window all tests become failed. Does Edge or MicrosoftWebDriver have any options to avoid that behavior?
As you have been trying to minimise the Browser Window while your Test Execution is In Progress it will be against all the Best Practices. At this point it is worth to mention that as Selenium mocks the User Actions hence Selenium needs Browser focus. If the focus is lost Selenium won't be able to execute the lines of code. Consider the following steps while your Test Execution :
Browser Maximize : While you execute your tests always keep the Web Browser maximized so majority of the elements are within the Viewport
As per best practices, you should try to execute your Test Scripts / Automation Framework in an isolated Test Environment away from Manual Intervention with all the required Software and Hardware configurations and setup.
You can find a detailed discussion in How to run chrome driver in background using selenium with Ruby for Mac OSx?
You also have an option to use Google Chrome or Mozilla Firefox in Headless version.
For Firefox you can find a detailed discussion in How to make firefox headless programatically in Selenium with python?
For Chrome you can find a detailed discussion in selenium.common.exceptions.WebDriverException: Message: 'chromedriver' executable needs to be in PATH error with Headless Chrome
For Ghost Browser you can find a detailed discussion in Which drivers support “no-browser”/“headless” testing?

is possible run selenium with headless browser to handle functionalities?

My objective is running automation based selenium webdriver from Jenkins, but jenkins cannot open browser when build job. so I modified my code to run in headless mode. since implementing headless browser, having some big question
is possible to handle end to end business on headless browser? cause end to end need inspect element as the process
if headless browser cannot handle, do you have some suggestion?
thanks, I'm very low to integrate automation
You don't have to change the code to run a Selenium test with Jenkins in headless mode.
You can use a Jenkins plugin of a headless X server to run your tests on an installed browser. You will even get screenshots.

How to run chrome driver in background using selenium with Ruby for Mac OSx?

Sometimes, the browser window comes to the foreground and I'm clicking it accidentally which makes the test fails on some occasions. So, I just want to know, is there any way that I can keep the chrome driver window in the background.
Details:
< ChromeDriver version: 2.28.455517 >
< Chrome version: 58.0.3029.96 >
A few words about the solution to your Question:
As per best practices, you should try to execute your Test-scripts / Automation-framework in an isolated Test Environment with all the required Hardware and Software configurations and setup.
While the execution is in process, there should be no manual user interaction in-between.
In-case you want to do multitasking, use Ghost/Headless Browsers. You will find a detailed discussion in Which drivers support “no-browser”/“headless” testing?.
Htmlunitdriver & PhantomJS are the two mostly widely used Ghost/Headless Browsers.
If you are specific about using ChromeDriver you can use Chrome headless as per the documentation here.
First and foremost rule is that we should not do any other work while your scripts are running. We may use actions class for hovering., etc, while you move your cursor it may lead to failing your test case. Hope It will be useful to you.
You can try using headless switch available for Chrome.
This will run the automation in the headless mode and you will not be disturbed.
options = Selenium::WebDriver::Chrome::Options.new
options.add_argument('--headless')
Afterward, initiate Chrome.

How to disable firefox from opening while running test suite in Selenium IDE?

I am writing test scripts in Selenium IDE for my application but everytime when I run the test suite it opens up browser and performs all the actions and logs failures, if any. My requirement is to invoke the test script from command prompt using .bat file and generate a test report. I am able to do the same but the problem is firefox opens up and executes the test case one by one. Can anyone please suggest me how to disable Firefox window from opening up? Or is it just not possible to do so? Or do I need to switch to Selenium Webdriver in order to achieve my requirement? My application contains Ajax upto a lot of extent.
I have read many commands used in Selenium IDE but I could not find any command which can serve this purpose. Please suggest!
If you know any programming language supported by selenium-webdriver (Ruby, Java, Python, C#) then you should try PhantomJS WebDriver which allow to run scripts without opening visual browser session
Selenium-IDE are mean to invoke browser, that's how the script react to all the exact browser behavior.
Only selenium Webdriver allow you to run your browser under "Headless" mode, which in fact, put Firefox under X-virtual frame buffer in background, as above #Andersson suggested.
Unfortunately, there is no easy way to convert your Selenium-IDE script to your desire programming language at the moment.
If your concern is about "cluttered screen" in OS such as ubuntu, then your solution will be export the whole Selenium-IDE and firefox under another virtual X-display.

Selenium Junits on headless browser

I have recorded scripts through Selenium IDE and converted them to JUnit 4 Webdriver scripts.
Of course converted scripts had to be changed to run smoothly as Junits. Now my next goal is to make these scripts run on CI, So obviously I need some headless browser for this purpose. I found some threads, but I am looking for Junits specifically.
What could be the best solution/approach for this, any help in this regard is appreciated.
Take a look at PhantomJS. It is a headless WebKit-based browser and there is Selenium WebDriver for that called GhostDriver.
That's what i use and is OK but there is also the option of using a headed browser like Firefox or Chrome and then use Xvfb to ignore screen output.