Hot answers tagged

4

public class Selenium_Grid { WebDriver driver; String baseUrl, nodeUrl; @BeforeTest public void setUp() throws MalformedURLException { baseUrl = "www.fb.com/"; nodeUrl = "http://192.168.1.57:6666(port_n0)/wd/hub"; DesiredCapabilities capibility = DesiredCapabilities.safari(); ...


3

Unfortunatelly I found only workaround solution (e.g. if you need several different Firefox versions on a single station): nodeConfig_1.json { "capabilities": [ { "browserName": "firefox", "version": "51", "platform": "WINDOWS", "maxInstances": 1, "marionette":true, "cleanSession": true }, ... gridNode_1.cmd ...


3

A Selenium Grid node is a computer system (virtual or physical) that is connected to a Selenium Grid hub. If you have 5 different browsers installed on a node it is still is just one node. Per node you can specify the maximum number of browser sessions that can be run in parallel on the node, this to manage and prevent the node running out of memory, cpu, ...


3

Normally both your home and the company networks are fire-walled, letting no external traffic in. There are two possible solutions: Poke holes in the company firewall for Selenium traffic back and forth Create a VPN-tunnel between both Poking holes Make sure the firewall and routers forward any traffic on port 4444 to the company internal Selenium hub OR ...


3

Your test runner is the source of all activity driven through the Selenium Grid. If you want more than 1 set of activity (more than 1 thread) to run at a time, then parallelism needs to come from your test runner. TestNG is the best ways to fork threads in my opinion, if all test activity comes from one test runner. (Gradle and Maven Surefire are another ...


3

This load test article is a great walkthru for your scenario - http://www.mkyong.com/unittest/testng-selenium-load-testing-example/


3

Agree with @Dale Emery. Use this code: public class WatchTV { WebDriver driver; WebDriverWait wait; int waitseconds = 60; public WatchTV(WebDriver driver){ this.driver = driver; wait = new WebDriverWait(driver, waitseconds); } By watchtvlink = By.linkText("Watch TV »"); public WebElement WatchTVLink() { ...


3

In your code you should instantiate two drivers. One instance for Chrome and the second one for IE. Now you can operate with both the browsers. Below is the example in Java: public static void main(String[] args) { // Configure both drivers System.setProperty("webdriver.chrome.driver", "Path to your chromedriver"); System.setProperty("webdriver....


2

You can view all of the nodes that are connected to the running hub/server by navigating to the following address in your browser: http://'hub_IP_address':'port'/grid/console# It will show what machines are connected, and it will show you which of the browsers are in use for each node.


2

Your Setup() method runs (and initializes the driver) only in the Pg_WatchTV_Test class. Merely extending TestBase does not cause TestNG to run your setup method. It runs setup methods (annotated by @BeforeMethod and the like) only if the class has test methods. Your WatchTV class has no tests, so TestNG does not treat it as a test class. So the Setup() ...


2

Your nice list covers all of the usual bases. Another possibility: Implement some sort of "critical region" mechanism around the individual pieces of data that are shared among tests, and that different tests require to have different values. This creates its own problems, of course. It causes one test to block while waiting for another to finish with the ...


2

Selectors like Xpath and CSS also support parent child relations. You need to find a element in the tree that you can certainly find. From there you can go the N-th child and on and on. In your case dijit_layout_ContentPane_90 has a parent which you might be able to find with a selector. Read: [UPDATED] https://www.w3schools.com/xml/xpath_axes.asp https://...


2

Xpath keeps changing? You can try using other ways to uniquely identify an element, for example, CSS selector. Unlike Xpath, which focuses on navigation, CSS selector focuses on element attributes. All of the possible element attributes have something in common, //*[@id="dijit_layout_ContentPane_23"]/div[2]/div[1] //*[@id="dijit_layout_ContentPane_24"]/...


2

I don't see the "Description" named column under Column Options via List View or Grid View. If the column is not listed under Column Options > Available Columns, then the column name does not exist as a default column name. Perhaps it is a custom column added by someone on your team. I would use Title & Step Actions columns to display any needed ...


2

SceenShotImageFormat was a relatively recent change in Selenium for .Net core, can you try with ImageFormat if you're not using .Net core and if that works I would recommend upgrading your entire Solution (Including the grid) to a more recent version of Selenium. Based on the code in the solution, it looks like it just switches it to the ImageFormat method ...


2

Be sure that you have enabled automated test runs for Safari: Ensure that the Develop menu is available. It can be turned on by opening Safari preferences (Safari > Preferences in the menu bar), going to the Advanced tab, and ensuring that the Show Develop menu in menu bar checkbox is checked. Enable Remote Automation in the Develop menu. 1.This is ...


2

I assume that the remote machine is locked, and thus AutoIT can not work. It works on your desktop because it is not locked. Solution: Keep the desktop unlocked (no screensaver etc). Of course, this reduces the security as well. Possible other solution: Instead of AutoIT, use Kantu for the file uploads. Kantu works inside Chromium, and runs fine on locked ...


2

Here is the general description of what you should do: Set up SeleniumGrid hub Set up nodes within different environments you would like to run your tests Isolate your test code within a separate method (of course it is better to use test frameworks like JUnit or TestNG). Your test method should take WebDriver as a parameter because you will have to re-...


1

Selenium only works with a browser-driver. So you cannot move outside the working area, i.e. your browser. You can use java method Actions to perform similar kind of tasks. If you have the coordinate where to click, you can try this. Actions builder = new Actions(driver); builder.moveToElement(element, X, Y).click().build().perform(); Hope this helps.


1

This is the suitable tool for your problem - BrowserMobProxy. With this, you could capture the traffic as a Har file. You could also block and bypass any request after analyzing the response to decrease the page load time for your automated testing services (if you are doing web automation). It is easily integrated with selenium. Sample code from git : // ...


1

Usually this issue come due to version of TestNG Plugin. So please upgrade your TestNG plugin Change Log of TestNG Issue Reported


1

Maybe this will help someone In my case, there was file upload form, thats hidden. So after making it visible (in this case, change class), its possible to use SendKeys and send file path to that element, thus uploading file (if it exists in that VM) Example: string filePath = "C://File//Path/File.txt"; IJavaScriptExecutor js = driver as ...


1

I figured it out. Removed driver=new FirefoxDriver(); because I'm already using driver = new RemoteWebDriver(new URL(Node), capabilities); so it is not needed. That was causing a duplicate blank browser loading first.


1

I haven't found a solution, rather an alternative. I have used Jenkins and used to BuildFLow plugin to create a Build Flow job. I use this job to call 3 other jobs to run parallel. The 3 other jobs are Maven jobs which are each pointing to their own test XML files which contains the tests classes I need to be run parallel. It greatly reduced the time of ...


1

I would assume that to run test cases in parallel, you need to have multiple instances of the same test - which is not possible if classes are static. In Agile development, when deciding which approach to use to solve a problem, good idea is try spike solution - in your example it would be before committing yourself to architecture, try one simple test (...


1

As per my understanding It is look like some charts or report related application page. Try with following approach : 1. Make BVT / Smoke scenarios : First determine the smoke scenarios (which configuration is mostly used by client ) Ask help from Domain specific person / Product Owner / Experience tester in same product. Make some test cases with only ...


1

Initially start writing test cases with single filter with all the condition like 1. Exact match 2. Like with Next start with a combination of fields in positive and negative condition with all combinations of filters in the grid.


1

We did it the same way using C#. Unless it is really slow I would leave it like this. The only suggestion I would have would be to give each cell a unique identifier so you can use the quick "by id" locator. You could also check that the MAX+1 rows / columns don't exist if you want to be really rigorous.


1

We had faced same issues in the past. On node server before launching new node check any existing instance was running. Forcefully close the browser instances before again passing control back. Added bat file to do this functionality. It works perfect.


1

IMHO the node config file is not formatted correctly (should be a valid JSON file). the "version":"6.1" the value should be string, and the “hubHost”: “192.168.28.74”: <--- shouldn't contain colon after the host hub address. And IMO you should define: "hub": "http://<address>:<port>/grid/register", too on the configuration area. here is ...


Only top voted, non community-wiki answers of a minimum length are eligible