How to set manually opened browser as Selenium webDriver - selenium

I am working on automating a web application.
I have many pages like login page etc. and I have many tabs. Each tab will open different page, for example, if I want to open page3, I have to go through page1 first then page2.
Here my problem is If I want to test some functionality on page3, then I have to go through all pages. It is taking so much time to test single functionality I need to spend so much time.
Is there any way I can set already opened browser as Selenium WebDriver?

Unfortunately, no.
This is the most starred feature request on Selenium as of now (February 2013, current Selenium 2.30.0). It's also one of the oldest.
http://code.google.com/p/selenium/issues/detail?id=18
There has been some work on Firefox for this, but it's undocumented, very experimental and no changes have been seen on it for quite a while. For more information, look at the linked feature request.
Front-end automation is hard, Selenium can only do what a normal user could do. The best you can do is to run the tests in parallel on many remote machines.

No... It is not possible....
In order to reduce the manual execution, we are moving towards automation.
Inbetween you cannot automate.

Related

Options for recording the tasks done in a browser for UI Automation Test

Is there a tool that can record user interactions with DOM elements for usage in creating automated tests (I'm using Codeception and Laravel Dusk but any tool with roots in Selenium is fine). I'm looking for something to record a sequence and get back a list that might include:
Browser navigate to /contact
Focus input "#name"
Enter text "Joe" in input #name
Focus textarea textarea[name=message]
Enter text "Hello world" in textarea textarea[name=message]
Click element input[type=submit]
Browser navigate to /contact?thanks
I see GhostInspector but that is tied directly into a cloud based company and I don't want that, I'd like some degree of control over what the plugin does and be able to record pages not on the public web.
I can see building a tool that recorded every action is non-trivial - mousemove events, focus, text selection, keyboard events, scroll events, etc. Ideally I can say "listen to every focus, click, and keyup event on an input or textarea or button or select or option" and also watch for url changes.
Does such a tool exist? Doesn't matter what browser stack it runs on really, just need the ability for a user, maybe a novice user, to go to a website, hit record, do some actions, and get back a list of what occurred.
The instantaneous downvotes that contend my question is "not about programming" prompt me to improve my question. I don't presume the nature of the tool - it might be programming methods? Ways to use the browser to listen for all events and log them in some manner? Might be a Chrome extension? Might be a framework? Might be a library? I'm looking for the experience of programmers to help me with the programming task I'm trying to accomplish.
Have you tried using the Chrome extension Laravel TestTools?
https://chrome.google.com/webstore/detail/laravel-testtools/ddieaepnbjhgcbddafciempnibnfnakl
Katalon Recorder (Selenium IDE for FF55+)
https://addons.mozilla.org/en-US/firefox/addon/katalon-automation-record/
The straight answer to your question is: Yes there are a number of tools available that are on top of Selenium. I will briefly discuss the top ones that also support browser extensions
1. New Selenium ID(Open Source)- Selenium is possibly the most popular open-source test automation framework for Web applications. The new Selenium IDE is designed to record your interactions with websites to help you generate and maintain site automation, tests, and remove the need to manually step through repetitive takes.
Features:
Recording and playing back tests on Firefox and Chrome.
Organizing tests into suites for easy management.
Saving and loading scripts, for later playback.
Selenium has become a core framework for other open-source test automation tools such as Katalon Studio, Watir, Protractor, and Robot Framework.
FireFox Extension
Chrome Extension
2. Kantu(Open-source)- It is a record & replay tool for automated testing, web automation, automating file uploads and autofill form filling. The visual UI testing commands of Kantu help web designers and developers to verify and validate the layout of websites (and canvas elements).
Features:
Kantu provides with built-in flow control commands like if/else/endif, while/endWhile or GotoIf
FireFox Extension
Chrome Extension
3. Katalon Automation Recorder- Katalon have Katalon Studio which is a completely free desktop application. Recently they launched new Selenium IDE that helps you record actions, capture web elements on web applications, play automated test cases, and do reporting quickly and easily.This Extension was the champion project of Katalon Studio Hackathons contest.
Features:
Record, play, debug with speed control, pause/resume, breakpoints capabilities.
Enjoy fastest execution speed compared to other extensions with Selenium 3 core engine.
Import test data from CSV files for data-driven testing.
Report easily with logs, screenshots capturing, with historical data and analytics from Katalon Analytics.
FireFox Extension
Chrome Extension
Few references for further comparison:
https://medium.com/#briananderson2209/best-automation-testing-tools-for-2018-top-10-reviews-8a4a19f664d2 (comments section will also helpful)
https://a9t9.com/blog/selenium-ide-2018/
https://www.g2crowd.com/categories/test-automation
https://www.qasymphony.com/blog/100-plus-best-software-testing-tools/

Launching selemium scripts from browser for screen capture

I am looking for creating a functional training package for a web based product (more like a screen capture).
However, the requirement is not just to have screen capture, but to have a test mode for the training where we can prompt the user to click on the screen and check if they have done proper flow.
for e.g. A banker will first go through the screen capture to see "how to open an account" in the core banking application . Later user will be presented with a test where user has to click through all the controls and flow.
I have seen selenium being used for authoring good UI automation test cases, so I wanted to explore the possibility of using selenium for creating these training modules
These training modules needs to be launched from intranet application. Is it possible to launch selenium authored UI automation test cases from the browser? I want to stay away from writing any extensions or plugins.
I haven't used selenium and I might be completely off tangent here, so any other suggestion to achieve this using open source tools are welcome.
Without writing any scripts, you may consider downloading Selenium IDE. It has a recording and replay function that may meet your need.
For a fast tutorial, please follow this link.
https://www.youtube.com/watch?v=gsHyDIyA3dg
Hope it helps.

How to simulate 20 users click a button at the same time in Web GUI Test Automation

Now I hava a requirement about Web GUI TA
I want to simulate some users(20-30) click a button at the same time and evaluate the performance of Web GUI at that time.
I use RobotFrameWork + Selenium library to do the Web Gui TA before, but as far as I know. selenium library only can handle one broswer at one time, so i dont know how to do now.
Can you give me some advice? need use another library or framework?
Like mentioned by other, what you want to do in this case is not UI testing but rather stress/load testing. You should be able to try easily Gatling. First you record the http request associated with the click on your button. Then, you write a simple scenario that launches this request 20 times at once. Something like:
setUp(scn.inject(atOnce(20 users)))
.protocols(httpConf)
Selenium has a "grid" option you can use to configure many instances running many browsers.
http://www.seleniumhq.org/projects/grid/
http://www.seleniumhq.org/docs/07_selenium_grid.jsp
Grid allows you to :
scale by distributing tests on several machines ( parallel execution )
manage multiple environments from a central point, making it easy to
run the tests against a vast combination of browsers / OS. minimize
the maintenance time for the grid by allowing you to implement custom
hooks to leverage virtual infrastructure for instance.
In short, you create a "hub" that manages things, then each "node" can perform tests as required by the hub.
Consider, however, this may not be the best route to go down. Something like multi-mechanize might be more useful: http://testutils.org/multi-mechanize/
That will allow you to have many users "clicking" the button, but not via a browser but via direct HTTP calls. That might be more suitable for multi user simultaneous "headless" load testing, which is what I think you are attempting to do.
I'm slightly confused at this question:
Are you wanting to test the GUI? If it's something like "This button makes a dropdown menu appear", then it doesn't matter how many users do it at the same time, it'll either always work, or never work.
Are you wanting to test the server under load? If so, then Selenium will work, but there are better tools. I have used JMeter with success, but there is a really good listing of all of them here: http://performance-testing.org/
Finally, are you wanting to press 20 different buttons on the same page on the same browser at the same time? If so, this isn't possible with selenium, and it isn't a standard use case either.

Taking screenshots of a page while its loading using Selenium WebDrivers

I have started using Selenium WebDrivers to automate some performance testing. I found out that we could take screenshots of a page after the page has completed loading using WebDrivers: http://seleniumhq.org/docs/04_webdriver_advanced.html#taking-a-screenshot. However, I want to be able to take screenshots while the page is loading to analyze its loading time and pattern, much like what webpagetest does (http://www.webpagetest.org/). Is there an API that I could use to accomplish this task using WebDrivers?
I am using the FirefoxWebDriver and the Java client for the same. I appreciate help or tips.
Thanks!
Since, I found out that the RemoteWebDriver's get calls are blocking and even the getScreenshot calls are blocking, I decided to run java.awt.Robot in a separate thread and capture screenshots while the WebDriver loads the page.
The only caveat is that the browser instance opened up by the WebDriver has to be in the front of the screen to take snapshots correctly. I am exploring if Robot can take snapshots on an Xvfb display, which would be just awesome and would work for my purposes.

TestComplete import testscenario from Selenium

Maybe this sounds ridicilous, but still, is there somekind of way to convert/import/hack selenium test scenario to get work on TestComplete?
I ask this, because my boss asked me to find a way, we are using Selenium, but our customer want us to give him TestComplete scripts, so we dont want to buy licence for 1 customer and i havent find any yet and belive there is no... maybe im missing something? Thanks you and have a nice day.
There is no direct ways to convert Selenium tests to TestComplete as these tools use different principles. Selenium works with web pages "from inside" (programmatically) while TestComplete does this "outside" by simulating user actions: it sends mouse clicks and key presses to the browser.
I think that it is possible to invoke Selenium tests from TestComplete, but you will not have any results in TestComplete and you will be unable to modify tests in it.
BTW, you can request a free 30-days trial if a month is enough for you to convert the tests.