M
M
maksimwork19802022-04-21 11:34:18
PHP
maksimwork1980, 2022-04-21 11:34:18

Why does Selenium output /session//element///text when getting the text of an element?

The same goes for getting attributes.

spoiler
<?php
namespace Facebook\WebDriver;
use Facebook\WebDriver\Remote\DesiredCapabilities;
use Facebook\WebDriver\Remote\RemoteWebDriver;
require_once('/var/www/sites/eat_catalog/php/vendor/autoload.php');
$host = 'http://localhost:4444/';
$capabilities = DesiredCapabilities::firefox();
$driver = RemoteWebDriver::create($host, $capabilities);
$driver->get('http://google.com');
$title = $driver->findElement(WebDriverBy::id('sign-in'))->getAttribute('title');
$inputElement = $driver->findElement(WebDriverBy::id('username'));
echo $value;
$driver->quit();
?>

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question