php - How to click visible element in PHPUnit Selenium2TestCase? -


i have 2 buttons same name. design reasons 1 of them visible @ same time.

i want click on visible button.

if first button hided expression

$this->bycssselector('[name="saveandclose"]')->click() 

returns

element not visible , may not interacted 

how click on visible button?

i have written simple code this.

public function clickondisplayedelementbyname($name)     {     $elements = $this->elements($this->using('css selector')->value('[name="' . $name . '"]'));     foreach ($elements $element)         {         if ($element->displayed())             {             $element->click();             return;             }         }     $this->fail('there no visible elements name ' . $name);     } 

Comments

Popular posts from this blog

matlab - Deleting rows with specific rules -

php - MySQLi multi_query results for later use -