minkphp / minkphp/Mink

submit form and get resulting page?!

Open
#864 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
PHP
Stars
1.6k
Forks
286
PR merge metrics
No merged PRs in 30d

Description

Hi, new to this, but having a maybe basic question.
My script successfully opens a session, loads a page, sets a certain form field to my needs.
Now I did this to find the submit button to submit the form:

$page = $session->getPage();
$marke = $page->findField('marke');
$marke->setValue('stern');
$button = $page->findButton('startSearch');
$button->submit();

But what now? How do I know this has worked? How do I get the resulting page?
I have tried:

$page2 = $session->getPage();
echo $session->getCurrentUrl();

But this shows the title of the first page. So my guess the submit did not work as expected.
Any hint appreciated. Please advise.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue names the PHP calls findButton('startSearch')->submit(), getPage(), and getCurrentUrl(), but no repository file or test is identified. Start by tracing those entry points to determine how form submission and the resulting page are represented; done means confirming the expected post-submit page retrieval behavior and documenting or testing it.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
web-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.