2gis / Winium.Desktop

Winium.Desktop is Selenium Remote WebDriver implementation for automated testing of Windows application based on WinFroms and WPF platforms.
Mozilla Public License 2.0
402 stars 140 forks source link

Table values are saved incorrectly in List array. Values are saved as "[WiniumDriver: on ANY (AwesomeSession)] -> xpath: //*[contains(@LocalizedControlType,'table')]" #324

Open git2shanki opened 4 years ago

git2shanki commented 4 years ago

Hi, I am automating desktop application using Winium. Here is the scenario.

  1. Launch the application
  2. Clicking a button the application will display table with client details in 4 columns and 16 rows that are added by the user.
  3. Need to validate each cell data having 'Name' tag value and take necessary actions later.

Here is my simple code and results shown in console.

WebElement mytable1 = winiumDriver.findElementByXPath("//*[contains(@LocalizedControlType,'table')]"); System.out.println("mytable 1 size : " + mytable1.getSize());

List < WebElement > clients_table1 = mytable1.findElements(By.xpath("//*[contains(@LocalizedControlType,'item')]")); System.out.println("Clients table 1 size : " + clients_table1.size()); System.out.println("Item details1 - 0th element: " + clients_table1.get(0));

List < WebElement > clients_table2 = mytable1.findElements(By.xpath("//[contains(@LocalizedControlType,'table')]//[@Name]")); System.out.println("Clients table 2 size : " + clients_table2.size()); System.out.println("Item details2 - 0th element: " + clients_table2.get(0));


Results in console:

mytable 1 size : (766, 192) Clients table 1 size : 259 Item details1 - 0th element: [[[[WiniumDriver: on ANY (AwesomeSession)] -> xpath: //[contains(@LocalizedControlType,'table')]]] -> xpath: //[contains(@LocalizedControlType,'item')]]

Clients table 2 size : 33 Item details2 - 0th element: [[[[WiniumDriver: on ANY (AwesomeSession)] -> xpath: //[contains(@LocalizedControlType,'table')]]] -> xpath: //[contains(@LocalizedControlType,'table')]//*[@Name]]

Please assist in understanding below clarifications

  1. Why I dont see the List data and its having strange values having text like 'AwesomeSession'. I dont understand this.
  2. Why the size is two dimensional and also the size varies though the records are just 16.
  3. Why the size varies for @LocalizedControlType,'item' and @Name in clients table 1 & 2.

Thanks, Shanki