Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Public Member Functions | Protected Member Functions
SeleniumSessionAnalyzer Class Reference
Inheritance diagram for SeleniumSessionAnalyzer:

Public Member Functions

 __construct (ObjectManagerInterface $objectManager)
 

Protected Member Functions

 configure ()
 
 execute (InputInterface $input, OutputInterface $output)
 

Detailed Description

Analyze if Selenium session connection is established.

Definition at line 17 of file SeleniumSessionAnalyzer.php.

Constructor & Destructor Documentation

◆ __construct()

__construct ( ObjectManagerInterface  $objectManager)
Parameters
ObjectManagerInterface$objectManager

Definition at line 29 of file SeleniumSessionAnalyzer.php.

30  {
31  parent::__construct();
32  $this->objectManager = $objectManager;
33  }
$objectManager
Definition: bootstrap.php:17

Member Function Documentation

◆ configure()

configure ( )
protected

Configure command.

Returns
void

Definition at line 40 of file SeleniumSessionAnalyzer.php.

41  {
42  parent::configure();
43  $this->setName('troubleshooting:check-selenium-session-connection')
44  ->setDescription('Check that Selenium session connection is established.');
45  }

◆ execute()

execute ( InputInterface  $input,
OutputInterface  $output 
)
protected

Execute command.

Parameters
InputInterface$input
OutputInterface$output
Returns
void @SuppressWarnings(PHPMD.UnusedFormalParameter)

Definition at line 55 of file SeleniumSessionAnalyzer.php.

56  {
57  $output = $this->objectManager->create(
58  \Magento\Mtf\Console\Output::class,
59  ['output' => $output]
60  );
61  $output->writeln("Verifying selenium server session...");
62  try {
63  $driver = $this->objectManager->create(Driver::class);
64  $driver->closeWindow();
65  } catch (\Exception $e) {
66  $output->outputMessages(['error' =>
67  [
68  'The Selenium Server session cannot be established. Check if:'
69  . PHP_EOL . "\tSelenium server is launched."
70  . PHP_EOL . "\tSelenium server host and port configuration are correct in etc/config.xml."
71  . PHP_EOL . "\tThere is a valid browser name in etc/config.xml."
72  . PHP_EOL . "\tSelenium server is run with appropriate driver."
73  . PHP_EOL . "\tSelenium server version is compatible with web browser version."
74  ]
75  ]);
76  }
77  $output->writeln('Verification of selenium server session is finished.');
78  }

The documentation for this class was generated from the following file: