New answers tagged

1

Refer to this question: https://stackoverflow.com/q/34152390/6793637 chrome.window.onRemoved.addListener(), works only when a chrome process is running. The `driver.quit()` closes all the chrome processes. Use driver.close() or Could you try this : // Initializing instance of Firefox WebDriver driver = new ChromeDriver(); wait = new ...


0

Did you try driver.close()? Quit() kills the browser, which probably does not give it the chance the trigger the events. Close() closes the active window but the browser stays open, although if it is the last window it might quit aswell, maybe you need to open an extra window first.


0

Simple answer (but a lots of maintenance in the future): Create IncognitoBaseClass which extends BaseClass, override method instantiateChromeDriver() and make your TestClasses derive from one of them. As you want them. Complex answers (one of them might be good): Create different packages for those tests, and use one for IncognitoTests and secon one for ...


2

You can override you private void instantiateChromeDriver() method in your child class (you have to change access modifier of the method in base class in order to do so) where you can instantiate the driver with the options you need in your child class. Here is a simple model of your architecture: Base class with its own initialization public class Base { ...


1

I realized I needed to instantiate a Remote Web Driver in order to obtain functionality remotely. Solved. if(browser.driver instanceof RemoteWebDriver) { new FlashPolicyHelper((RemoteWebDriver) browser.driver).addSite(odysseyURL) } browser public class FlashPolicyHelper { private final RemoteWebDriver driver; public FlashPolicyHelper(RemoteWebDriver ...


3

Your xpath locator is wrong , try the below xpath: /html/body/div/div/footer/md-toolbar/div/div[2]/img[2]/../../../../../../../../body[@class="layout-column md-dialog-is-showing"] The errors were , space after /html/body/div/div/footer/md- more than one space character after body[@class="layout-column You navigated back to parent only seven times, ../../...


1

For of all thank everyone for your help! The answer was quite simple and I hope some of the senior members dont get mad. In order to access the elements on the second page all I that needed to be done is switch to the correct tab. ArrayList<String> tabs2 = new ArrayList<String>(driver.getWindowHandles()); driver.switchTo().window(tabs2....


2

It seems the second page is opening in a new tab, please switch the tab before interacting with the page: driver.findElement(By.xpath("/html/body/div[4]/div[2]/div[2]/div[2]/div[2]/div[2]/div[2]/div/div[4]/div[1]/div/div/div[2]/div[1]/span[1]/strong/span/div/ul/li[1]/span/a")).click(); ArrayList<String> tabs = new ArrayList<String>(driver....


0

Check your selenium and chrome version. I don't think the issue is related to locator. I tried it in my local and it's working fine. I used xpath //a[text()='VIDEO'] Here's the log. At the last part, you will notice that it locates the element and click it. pool-1-thread-1: Executing get parameters: {"url":"https://mmashare.fullfight.video/viewtopic.php?t=...


Top 50 recent answers are included