-
Notifications
You must be signed in to change notification settings - Fork 3
Initializing seleniumJavaExperiment #12
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
base: master
Are you sure you want to change the base?
Changes from 1 commit
d3df2d4
a61c00c
b4024ab
f27b9aa
198de03
fc7f368
129e8bf
99231d8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package pageObjects; | ||
|
||
import org.openqa.selenium.WebElement; | ||
import org.openqa.selenium.support.FindBy; | ||
import org.openqa.selenium.support.ui.Select; | ||
|
||
public class DropDownPage { | ||
@FindBy(css = ".example h3") | ||
WebElement pageTitle; | ||
|
||
@FindBy(id = "dropdown") | ||
WebElement dropdown; | ||
|
||
public String getTitleText () { | ||
return pageTitle.getText(); | ||
} | ||
|
||
public void openDropDown(){dropdown.click();} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. When using select, you do not need to open the dropdown. You can directly use select. |
||
|
||
public void selectOptions(String option){ | ||
Select opt= new Select(dropdown); | ||
opt.selectByVisibleText(option); | ||
|
||
} | ||
|
||
public String returnDropdownValue(){ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Accept the web Element as a parameter. |
||
Select opt= new Select(dropdown); | ||
WebElement dropdownx= opt.getFirstSelectedOption(); | ||
String value= dropdownx.getText(); | ||
return value; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please fix the indentations. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @kenil-fadia I'll connect with you to help me out with this. |
||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Avoid logs if possible.