Open GoogleCodeExporter opened 9 years ago
That's because the Urls you're providing are not valid (the protocol is missing
in front).
When the protocol is missing, the root Url defined by the start command is
added in front.
This is why you get "http://www.google.com/www.amazon.com" in the address.
Try these Urls instead:
https://www.facebook.com
https://www.yahoo.com
https://www.google.com
https://www.amazon.com
Or add the protocol before calling the open command:
Dim r
For Each r In Range(Sheet1.Cells(2, 1), Sheet1.Cells(2, 1).End(xlDown))
selenium.executeScript "window.open()"
selenium.Open "https://" & r
Next r
Original comment by florentbr
on 10 Jan 2015 at 2:56
Hi florentbr
Thank you for your reply.
I tried using firefox and it managed to open 3 tabs instead of 4 tabs. I
noticed that the 2nd tab first's address is yahoo then it changes to google. it
is kind of weird. (Please refer to the attached screenshot, firefox.png)
As for chrome, it opens up 4 tabs. first tab is amazon because it went through
all the URLs on the same tab. (Please refer to the attached screenshot,
chrome.png)
Thanks for the insight!
Original comment by jonkh...@gmail.com
on 10 Jan 2015 at 3:20
Attachments:
You need to set the window on which the driver will operate before opening the
Url:
wd.executeScript "window.open()"
wd.switchToWindow -1 'Switch to the last window
wd.Open ...
Original comment by florentbr
on 10 Jan 2015 at 3:51
Hey florentbr
Thank you for the help!
The line, 'wd.switchToWindow -1' helps to ensure that each website is opened in
each tab for chrome. (Please refer to the attached screenshot, chrome2.png)
However, it does not work for firefox unless I used this
'selenium.executeScript "window.open()"' instead of this code, '
selenium.SendKeys keys.Control & "t"' which opens up the 3 tabs instead of 4
tabs. Also, 2nd tab first's address is yahoo then it changes to google.
Hopefully this thread will be useful for someone who want to work on firefox
later since it works for chrome browser.
Once again florentbr.
This will be good:
http://selenium.googlecode.com/svn-history/r5810/webdriver/javadoc/org/openqa/se
lenium/remote/server/handler/SwitchToWindow.html
Thank you for the help.
Original comment by jonkh...@gmail.com
on 11 Jan 2015 at 12:07
Attachments:
Original issue reported on code.google.com by
jonkh...@gmail.com
on 10 Jan 2015 at 4:54