Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

clickLink not working with special characters. #581

Open
iBuaSpaz opened this issue Dec 28, 2022 · 1 comment
Open

clickLink not working with special characters. #581

iBuaSpaz opened this issue Dec 28, 2022 · 1 comment

Comments

@iBuaSpaz
Copy link

iBuaSpaz commented Dec 28, 2022

Hi, seems this wont work with special characters like »

This is the code

<?php
include('../vendor/autoload.php');

use PHPUnit\Framework\TestCase;
use Symfony\Component\BrowserKit\HttpBrowser;
use Symfony\Component\Panther\Client;

class PantherTest
{
	public function __construct() 
	{
	}

	function test()
	{
		try
		{
			$options = [
            '--headless',
            '--no-sandbox',
            '--disable-gpu'
            ];

			$client = Client::createChromeClient('D:\xampp\htdocs\drivers\chromedriver.exe', null, $options, null);
			$client->request('GET', 'https://www.lauritz.com/da/auktioner/?IST=0&SelectedTab=12');

			$crawler = $client->waitFor('#FooterArticleControl_BackToTopText');
			$client->takeScreenshot('screen.png'); // Yeah, screenshot!

			// remove cookie popup
			try {
				$link = $client->clickLink('Tillad alle cookies');
			}
			catch(InvalidArgumentException $e){}

			$client->clickLink('»');

			$crawler = $client->waitFor('#FooterArticleControl_BackToTopText');
			$client->takeScreenshot('screen1.png'); // Yeah, screenshot!

			print "* success <br>";	
		}
		catch(Exception $e)
		{
			print "* Error " . var_dump($e) . "<br>";
		}
	}
}

$testclient = new PantherTest();
$testclient->test();
?>

The error is:

object(Facebook\WebDriver\Exception\ElementClickInterceptedException)#18 (8) { ["message":protected]=> string(311) "element click intercepted: Element ... is not clickable at point (345, 602). Other element would receive the click:
...

So it seems to select the menu ... instead of choosen », and the ... isnt active on first page..

menu

@jumaris88
Copy link

Obviously, the element you want to click is blocked by another element. Check your page carefully.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants