browser getting opened as "Not Secure" connection during selenium execution

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

browser getting opened as "Not Secure" connection during selenium execution

Vikram Verma
Hi All,
I am executing a piece of code where the new browser window open as not secure. Also, scam pop up windows start opening right next to the intended URL window. I am not able to figure out the linked issue. Everything works fine when I am navigating manually. Also, the issue is not browser or URL specific. I have tried both Mozilla and Chrome with multiple URLs.

URL: "https://letskodeit.teachable.com/p/practice/"
 Eclipse Version: 4.7.2
Chrome version: 64
Chrome driver Version: 2.35



Screenshot: 

code:

package jUnitDemo;


import static org.junit.Assert.*;


import java.util.List;
import java.util.concurrent.TimeUnit;


import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.chrome.ChromeOptions;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.remote.DesiredCapabilities;
import org.openqa.selenium.support.ui.Select;


public class WebelementsTest {
 
 
static WebDriver driver;
 
static String baseURL;
 
String k;


 
@BeforeClass
 
public static void setUpBeforeClass() throws Exception {
 
ChromeOptions options = new ChromeOptions();
 
DesiredCapabilities caps = new DesiredCapabilities();
 options
.addArguments("--disable-popup-blocking");
 caps
.setCapability(ChromeOptions.CAPABILITY, options);
 driver
= new ChromeDriver();
 baseURL
="https://letskodeit.teachable.com/p/practice/";
 
//baseURL="https://google.com";
 driver
.manage().window().maximize();
 driver
.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
 
}
 
 
@Test
 
public void test() throws InterruptedException {
 driver
.get(baseURL);
 
Thread.sleep(5000);
 
WebElement radio = driver.findElement(By.id("bmwradio"));
 radio
.click();
 
boolean t=radio.isSelected();
 
System.out.println(t);
 
 
WebElement lst= driver.findElement(By.id("carselect"));
 
Select sel=new Select(lst);
 sel
.selectByIndex(1);
 
 
//printing the selected options
 
List<WebElement> seloptions= sel.getAllSelectedOptions();
 
for (WebElement opt:seloptions) {
 
 
}
 
 
}


 
@AfterClass
 
public static void tearDownAfterClass() throws Exception {
 
//driver.quit();
 
}


 
}

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/28f5fcc0-cb57-452b-a184-a2a239a11fcc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: browser getting opened as "Not Secure" connection during selenium execution

advanceautomation28
Is this issue fixed? 
If so, I'm interested to know how? 




On Monday, February 5, 2018 at 10:56:07 PM UTC-6, Vikram Verma wrote:
Hi All,
I am executing a piece of code where the new browser window open as not secure. Also, scam pop up windows start opening right next to the intended URL window. I am not able to figure out the linked issue. Everything works fine when I am navigating manually. Also, the issue is not browser or URL specific. I have tried both Mozilla and Chrome with multiple URLs.

URL: "<a href="https://letskodeit.teachable.com/p/practice/" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fletskodeit.teachable.com%2Fp%2Fpractice%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEW0Ie_8mMDZIF_dONCGmjdKbHp5A&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fletskodeit.teachable.com%2Fp%2Fpractice%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEW0Ie_8mMDZIF_dONCGmjdKbHp5A&#39;;return true;">https://letskodeit.teachable.com/p/practice/"
 Eclipse Version: 4.7.2
Chrome version: 64
Chrome driver Version: 2.35



<a href="https://lh3.googleusercontent.com/-LReYwdh6Ies/Wnkl7hscodI/AAAAAAAAAAQ/Ztt6ZXfd2QgkpJsnKzppQijQRHkkjeKKACLcBGAs/s1600/insecure%2Bconnection.JPG" style="margin-left:1em;margin-right:1em" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://lh3.googleusercontent.com/-LReYwdh6Ies/Wnkl7hscodI/AAAAAAAAAAQ/Ztt6ZXfd2QgkpJsnKzppQijQRHkkjeKKACLcBGAs/s1600/insecure%2Bconnection.JPG&#39;;return true;" onclick="this.href=&#39;https://lh3.googleusercontent.com/-LReYwdh6Ies/Wnkl7hscodI/AAAAAAAAAAQ/Ztt6ZXfd2QgkpJsnKzppQijQRHkkjeKKACLcBGAs/s1600/insecure%2Bconnection.JPG&#39;;return true;">

Screenshot: 

code:

package jUnitDemo;


import static org.junit.Assert.*;


import java.util.List;
import java.util.concurrent.TimeUnit;


import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.chrome.ChromeOptions;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.remote.DesiredCapabilities;
import org.openqa.selenium.support.ui.Select;


public class WebelementsTest {
 
 
static WebDriver driver;
 
static String baseURL;
 
String k;


 
@BeforeClass
 
public static void setUpBeforeClass() throws Exception {
 
ChromeOptions options = new ChromeOptions();
 
DesiredCapabilities caps = new DesiredCapabilities();
 options
.addArguments("--disable-popup-blocking");
 caps
.setCapability(ChromeOptions.CAPABILITY, options);
 driver
= new ChromeDriver();
 baseURL
="<a href="https://letskodeit.teachable.com/p/practice/" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fletskodeit.teachable.com%2Fp%2Fpractice%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEW0Ie_8mMDZIF_dONCGmjdKbHp5A&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fletskodeit.teachable.com%2Fp%2Fpractice%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEW0Ie_8mMDZIF_dONCGmjdKbHp5A&#39;;return true;">https://letskodeit.teachable.com/p/practice/";
 
//baseURL="<a href="https://google.com" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://google.com&#39;;return true;" onclick="this.href=&#39;https://google.com&#39;;return true;">https://google.com";
 driver
.manage().window().maximize();
 driver
.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
 
}
 
 
@Test
 
public void test() throws InterruptedException {
 driver
.get(baseURL);
 
Thread.sleep(5000);
 
WebElement radio = driver.findElement(By.id("bmwradio"));
 radio
.click();
 
boolean t=radio.isSelected();
 
System.out.println(t);
 
 
WebElement lst= driver.findElement(By.id("carselect"));
 
Select sel=new Select(lst);
 sel
.selectByIndex(1);
 
 
//printing the selected options
 
List<WebElement> seloptions= sel.getAllSelectedOptions();
 
for (WebElement opt:seloptions) {
 
 
}
 
 
}


 
@AfterClass
 
public static void tearDownAfterClass() throws Exception {
 
//driver.quit();
 
}


 
}

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/58c598bd-b280-4f95-9aef-8600efad4c0b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.