how to select checkboxes randomly and i want to click Whatever the randomly selected checkboxex to click ok

here is my code while executing raising an error as “Element is not clickable at point (151, 605). Other element would receive the click: <div id=”debug-toolbar”>…</div>
(Session info: chrome=37.0.2062.120)
(Driver info: chromedriver=2.9.248304,platform=Linux 3.11.0-26-generic x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 60 milliseconds”
pls provide a solution
im attaching my code


package com.selenium;
import java.util.List;

import java.util.Random;
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.firefox.FirefoxDriver;

import org.openqa.selenium.support.ui.Select;
public class Status_manage {

public static void main(String args[]) throws InterruptedException

{

System.setProperty("webdriver.chrome.driver", "/home/surekha/Documents/surekha/chromedriver");

ChromeDriver driver=new ChromeDriver();

driver.get("https://208.22.99.60/idvadminnew_dev/index/index");

driver.findElement(By.name("username")).sendKeys("jeevan@innovateapps.com");

driver.findElement(By.name("password")).sendKeys("innovate");

driver.findElement(By.name("submit")).click();

// Thread.sleep(9000);

// driver.findElement(By.id("submitbutton")).click();

driver.findElement(By.id("existingcompanyimage")).click();

Select status=new Select(driver.findElement(By.id("status")));

List<WebElement> soptions = status.getOptions();

int osize=soptions.size();

for(int i=1;i<osize;i++)

{

// String sus="Suspended";

// String ovalue=status.getOptions().get(i).getText();

// System.out.println("Option value:"+ovalue);

status.selectByVisibleText("Active");

driver.findElement(By.name("search_btn")).click();

Thread.sleep(20000);
List<WebElement> checkbox = driver.findElements(By.id("checker"));

int csize=checkbox.size();

String checkValues[]=new String[csize];

for(int j=0;j<csize;j++)

{
String cvalue= checkbox.get(j).getAttribute("name");

// System.out.println("Checkbox names"+cvalue);

checkValues[j]=cvalue;

Thread.sleep(2000);

}
for(int k=checkValues.length-1;k>0;k--)

{

Random rnd = new Random();
// System.out.println("ArrayValues"+checkValues[k]);

if(rnd.nextInt(k+1)==k)

{

driver.findElement(By.name(checkValues[k])).click();

Thread.sleep(3000);

}

}

driver.findElement(By.id("susp")).click();

Thread.sleep(2000);

driver.findElement(By.xpath("//button[text()='OK']")).click();
// if(ovalue.contentEquals(sus))

// {

//

// driver.findElement(By.id("unsusp")).click();

// Thread.sleep(3000);

// driver.findElement(By.xpath("//button[text()='OK']")).click();

// System.out.println("success");

// }
}
}

}

Train Asked on November 7, 2014 in Selenium WebDriver.

Question is very confusing , Can you try to rephrase it

on November 7, 2014.
Add Comment
  • 0 Answer(s)
  • Your Answer

    By posting your answer, you agree to the privacy policy and terms of service.