Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #players names :: positions
- Happ = CF
- Bryant = 3B
- Rizzo = 1B
- Contreras = C
- Schwarber = LF
- Russell = SS
- Heyward = RF
- Baez = 2B
- Chatwood = P
- public class DriverManager {
- public static WiniumDriver driver;
- private String setupfile_path="C:\Users\Naveen\Desktop\winium\setup.exe";
- private String winium_path="http://localhost:9999";
- public Properties prop;
- public DriverManager() throws MalformedURLException, InterruptedException
- {
- File file = new File("config.properties");
- FileInputStream fileInput = null;
- try {
- fileInput = new FileInputStream(file);
- } catch (FileNotFoundException e) {
- e.printStackTrace();
- }
- //load properties file
- prop = new Properties();
- try {
- prop.load(fileInput);
- } catch (IOException e) {
- e.printStackTrace();
- }
- DesktopOptions option =new DesktopOptions();
- option.setApplicationPath(setupfile_path);
- driver=new WiniumDriver(new URL(winium_path), option);
- }
- public void awayTeamHitters() {
- try {
- Thread.sleep(4000);
- WebElement table = driver.findElement(By.xpath(".//*[@AutomationId='lsvAwayTeamHitters1']"));
- List<WebElement> row= table.findElements(By.xpath("./*[contains(@LocalizedControlType, 'item')]"));
- int row_size = row.size();
- int col_size = 0;
- for(int i=0;i<row.size();i++)
- {
- List<WebElement> col = row.get(i).findElements(By.xpath("./*[contains(@LocalizedControlType, 'text')]"));
- col_size = col.size();
- for(int j=3;j<=col.size();j++)
- {
- Thread.sleep(40000);
- String celtext = col.get(j).getAttribute("Name");
- System.out.println(celtext);
- Thread.sleep(4000);
- }
- Thread.sleep(20000);
- }
- }
- catch (Exception e) {
- System.out.println(e);
- }
- }
Add Comment
Please, Sign In to add comment