Repository navigation
modified ruby locator code - #2993
rpallavisharma wants to merge 15 commits into
Conversation
👷 Deploy request for selenium-dev pending review.Visit the deploys page to approve it
|
Qodo reviews are paused for this user.Troubleshooting steps vary by plan Learn more → On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
|
@aguspe can you please help in here to fix this. i don't understand the error. i see its generated because of relative locators. let me know what to fix. thanks. |
|
Hi @rpallavisharma ! So the error is not really your code, the problem is that I fixed it locally by overriding the context 'with relative locators' do
let(:url) do
form = <<~HTML
<form>
<label id="lbl-email" for="email">Email</label> <input id="email" type="email"><br>
<label id="lbl-password" for="password">Password</label> <input id="password" type="password"><br>
<button id="cancel" type="button">Cancel</button> <button id="submit" type="button">Submit</button>
</form>
HTML
"data:text/html,#{form}"
end
it 'finds element above' do
ele = driver.find_element(relative: {tag_name: 'input', above: {id: 'password'}})
expect(ele.attribute('id')).to eq('email')
end
it 'finds element below' do
ele = driver.find_element(relative: {tag_name: 'input', below: {id: 'email'}})
expect(ele.attribute('id')).to eq('password')
end
it 'finds element to the left' do
ele = driver.find_element(relative: {tag_name: 'button', left: {id: 'submit'}})
expect(ele.attribute('id')).to eq('cancel')
end
it 'finds element to the right' do
ele = driver.find_element(relative: {tag_name: 'button', right: {id: 'cancel'}})
expect(ele.attribute('id')).to eq('submit')
end
it 'finds near element' do
ele = driver.find_element(relative: {tag_name: 'input', near: {id: 'lbl-email'}})
expect(ele.attribute('id')).to eq('email')
end
it 'chains relative locators' do
ele = driver.find_element(relative: {tag_name: 'button', below: {id: 'email'}, right: {id: 'cancel'}})
expect(ele.attribute('id')).to eq('submit')
end
endWith that I get One more thing, the
I hope this helps!😊 |
|
Oh ... I took the java example and converted to ruby Thank you for the help @aguspe i will fix that and the line number. Hopefully it will work. |
|
@aguspe can you please help why windows is failing? I'm unable to figure this out. |
|
@aguspe , i think failures are not related to this PR. please can you verify this. thanks. |
|
Hi @rpallavisharma ! You are right, the Windows failures have nothing to do with your changes The only test that still fails after the retries is Your locator specs pass on all platforms, so from my side this is good. I can look into the mouse spec separately so it stops blocking PRs! :) |
|
Thank you @aguspe . @diemol / @AutomatedTester kindly please either of you merge the PR . thank you. |
There was a problem hiding this comment.
Hi @rpallavisharma ! almost there :) there is still an old #L7 in the Ruby tab under "Utilizing Locators", it should be #L12 (locators.en.md 321, ja 319, pt-br 322, zh-cn 323). I can't comment on those lines because they are not in the diff
|
@aguspe , i think all is good now. please confirm. @diemol /@AutomatedTester, please merge. thanks. |
|
@SeleniumHQ/selenium-tlc please see. |
Thanks for contributing to the Selenium site and documentation!
A PR well described will help maintainers to review and merge it quickly
Before submitting your PR, please check our contributing guidelines.
Avoid large PRs, and help reviewers by making them as simple and short as possible.
Description
fixes the ruby code by making it executable as with respect to other bindings. fixes #2952
Motivation and Context
the ruby code earlier just holded elements information didn't do anything.
Types of changes
Checklist