Nightwatch switchWindow() not working in Google Chrome - google-chrome

I have a test that cause a new window to open that contains a form to fill out. In FireFox it works to switch to this window using browser.switchWindow(windowName), but in Chrome it does not seem to switch to the window as it is then unable to find the form to fill out in the new window.
Anyone run into anything like this and have a possible solution? Thanks!
Edit:
This is a small code snippet I found showing what I did.
browser
.click('selector') // Button click to open new window
.pause(1000)
.switchWindow('newWindowID')

I got it to work, for me it was as simple as putting a short pause() before trying to switchWindow(). It seems it tried to switch to the new window before it actually opened.

I can't leave a comment because of not a high enough reputation, but I was wondering if you could show your code for the solution to this. I am trying to figure out how to get this same scenario to work, and am stumped. Thanks

if it is not working for some of you, specially in mac machine then try below thing :
Starting with version 75, Chromedriver has W3C Webdriver protocol enabled by default. If you'd like to stick to the JSONWire for now adjust the chromeOptions:
chromeOptions: {
w3c: false
}
into nightwatch.json file

Related

How to use chrome breakpoint debugging tools with VueJS?

I develop with VIM, and I am trying to find a way to use chrome breakpoints for my frontend Vue.js app. I'm also using nuxt to develop my app with Vue.
Has anyone been able to successfully set a breakpoint in chrome without having to use vscode as their editor? If so what changes did they have to make?
For clarity's sake, I have of course tried entering debugger into my JS code, and I have also clicked on the left side of the source file in the chrome to apply a breakpoint on a particular line. Neither of these ways of applying a breakpoint have worked for me.
As I know There 2 way to use break point in these framework :
First, add debugger; in your code where you want like below:
methods: {
test() {
let x = 15 * 5
debugger
//// other code
}
},
Second, open developer mode in source file found the place you want to have break point and click left side of it :)

How can I make the advanced button work in chrome 'App isnt verified'?

I'm sorry this question might not be completely on topic, but i couldn't find answers googling it.
I'm creating an google app script (with clasp).
When i run the script i get the following popup as usual:
I'm supposed to click on advance and go anways.
But the advanced button no longer works! it doesn't show me the followup button to continue anymore!
Does anyone have the same issue and was able to fix it? It seems to have originated after the chrome update (with rounded ui).
I tried deleting the original grant (i added a feature that needed bigger scope), but even that didn't work.
It might be one of my chrome extensions.
Doing the same thing in incognito mode, worked!

Safari extension full control over tabs

I have made a chrome extension that I should convert to safari and firefox. That's fine, but I want to have full control over tabs. In my chrome extension I have full control over the tab even if user changes location (index) or drag the tab to a new window. With Safari's API, I'm not sure if I can achieve the same control. I could not find any events that can give me information about these events. I will probably be able to achieve the same control with various tricks, but would rather avoid it if possible. Hope there is someone who has had the same challenge and solved it in an elegant way. thank you in advance.

Change options of the current Chrome App window

I'm trying to change the minWidth of a Chrome App window who is already opened.
I've tried many things with chrome.app.window.current()but I can't find how to change (or even see) what is the current window's minWidth or minHeight.
Does someone know how to do it?
Thanks.
This feature is being added now. You can follow the progress in the apps-dev group discussion, as well as watching the progress of the actual code change.

Is there an alternative to watir::ie.attach for watir-webdriver since attach is not supported on webdriver

I have a website which is only rendered in Webkit enabled browser (Google Chrome, Safari). I am using Google Chrome since I am on Windows 7.
I am using Watir-WebDriver to automate the same.
Issue: When I click on a button on the browser window, is launches another window and post click content is rendered in the new browser window. I need a way to be able to Identify this new browser window, in-order to be able to proceed with my testing. I have been reading on various forums, but not getting any certain answer/solution.
Q: Is there an alternative to watir::ie.attach for watir-webdriver since attach is not supported on Watir-Webdriver
Sample code:
require "rubygems"
require "watir-webdriver"
require "selenium-webdriver"
b = Watir::Browser.new(:chrome)
website = "http://xyz.com"
#a new browser is launched and the website is opened
b.goto(website)
#this opens a new browser window
b.link(:xpath,"/html/body/div/ul/li/a").click
#there is a button called "MAP" on the new browser window
b.link(:id,"btn_MAP")
#this gives an error, unknown link
"window" method is the alternative for ie.attach. Webdriver can handle the window opened by itself with window method.
b.link(:href,/server\/getPage/).click
b.window(:url,/server\/getPage/i).use do
b.link(:id,"btn_MAP").click
end
you can handle popped up windows in the window method block. If you want to keep handling popped up window, use it without block, like window(:url,/foobar/).use
see also:
http://groups.google.com/group/watir-general/browse_thread/thread/232df221602d4cfb
#Yutaka: Thanks a lot for all your help it lead me to use something like the following and it worked!
b.link(:xpath,"/html/body/div/ul/li/a").click
c = b.window(:url,"http:\/\/server\/getPage\/67\/1354")
c.use
b.link(:id,"btn_MAP").click
have you tried making the website the default homepage for the browser?
that might prevent you from having to do an attach.