While I'm running protractor tests, each scenario creates new session, opens new Chrome window and changes focus on that window.
I'm looking for solution which either won't focus on newly created session, or will run all tests in background.
The tricky part is:
I'm using directConnect: true flag
in hooks in AfterScenario browser.restart() is invoked
Thanks for any advices.
Related
im having an issue when im running my robot tests.
The application under test (AUT) has a button that opens a new tab when you click it. It works on Chrome and IE when a user actually clicks that button. However, when i run my test to test that functionality in IE, the test opens a new window and that window is not being recognized (i used the SELECT WINDOW keyword in selenium2library)
Has anybody encountered this? is this an IE11 issue or IEWebDriver issue or something?
Here is my system specs:
OS - Windows 7
Browser - IE11
Robot Framework Version - 3.0.2
IEDriverServer version - 3.4
Thank you. i hope someone can help me.
When you run your test in IE the test opens a New Window instead of a new TAB is actually perfect.
As per #JimEvans on the github issue Selenium 3.7.1-IEDriverServer 3.7.0 : IEDriverServer opens a new Window instead of new TAB when JavascriptExecutor is used :
This is by design that a new window is opened.
I have a XBAP application that I want it to check for updates each time before it runs. But for some reason Install Mode and Settings section and Updates button are disabled there.
By default its set to available online only so I thought it always checks for updates in this state but that's not the case. When I change the published package in inetpub and then run the application again, it still runs the previous, cached one and it doesn't open the updated version until I remove the app from the cache with mage.exe. So I thought that I should do some configuration in Updates section.
I'm open to any kind of suggestions that helps me to figure out how to check for updates for this XBAP application each time right before it runs.
Here's how it looks line in Publish section:
I am using Windows.Forms.SendKeys.SendWait to interact with the native windows dialog when uploading an image.
I click the upload button using webdriver, then go:
SendKeys.SendWait("^A"); //Highlight content so it can be overwritten
SendKeys.SendWait(path);
SendKeys.SendWait(#"{Enter}");
Works great when I run it locally on my PC, however, the test won't run on the TeamCity agent (I have many other tests that run OK). It fails as it seems that native dialog never appears or if it does, it can't interact with it.
Not sure what's happening as this whole test agent process runs in the background and I can't see what it's doing - I can take screenshots using webdriver but it won't capture native dialogs anyway.
I tried to configure the team city test agent windows service (change Log On settings to allow interacting with desktop) but this did not work. Seems it just isn't able to interact with it... any ideas on how to make this work?
In order to upload a file with Selenium, you should use Webdriver's SendKeys directly to the input element that requires the path (Not Forms.SendKeys). See this example.
Note: You'll need to avoid clicking the button that opens the dialog.
I have a question: Is it posible to continue with execution of one test, if I have earlier closed browser in it?
For example, I want to check is the user in my application logged in, even when I restart browser. I want to check that with and without "Remember me" checkbox.
After I login my user in app, I try with this:
browser.close();
but test ends and can not be continued further.
If i try with this:
browser.get("");
browser.get("about:blank");
only blank tab is open, and test ends.If I try with:
browser.quit();
than whole session is killed and test is ended,
If anyone knows solution, or have some ideas, please answer. Thanks
You'll be able to do this with the next release of Protractor, which includes the new browser.forkNewDriverInstance function. This lets you create a new instance of your browser via webdriver. See the commit (https://github.com/angular/protractor/commit/0bbfd2b6d38392938781d846ad37b5a0fd964004) for more information.
I have an instance where user try to log-in application (simple webpage). After successful log in, the application closes the current page and open a new webpage. Rest of the business operations start from there.
Till the point API clicks log-in button, everything goes fine. After log in (once the log in webpage closes and a new session gets opened), the API throws "Unable to find browser". This is true as the original driver instance has been closed by the application.
Is there a way to achieve these kind of scenarios using selenium, as they are very common now-a days in a typical business application.
Thanks.
If you need to driver a different browser window or iframe, you need to use switchto. From the WebDriver faq:
Q: How do I handle pop up windows?
A: WebDriver offers the ability to cope with multiple windows. This is done by using the "WebDriver.switchTo().window()" method to switch to a window with a known name. If the name is not known, you can use "WebDriver.getWindowHandles()" to obtain a list of known windows. You may pass the handle to "switchTo().window()".
Thanks for the Answer.
I did the below to achieve my query.
Execute a javascript to open a new window.
IJavaScriptExecutor jScript = driver as IJavaScriptExecutor;
jScript.ExecuteScript("window.open()");
Switch to the newly opened window.
List<string> handles = driver.WindowHandles.ToList<string>();
driver.SwitchTo().Window(handles.Last());
Start the Navigate and Login operation on the new window
driver.Navigate().GoToUrl("Your website");
After login, the application will close the new window but the main driver window will still be alive.
Implement a simple SwitchTo() for the new window to start new business operations
List<string> handles = driver.WindowHandles.ToList<string>();
driver.SwitchTo().Window(handles.Last());