Contributions
Re: [TechCorner Challenge #11] Converting UTC TimeDate in an Excel file
Task: Read the UTC DateTime in an Excel file (attached), convert the value for the PST (Pacific StandardTime) time zone and log each date in the following format: <month name> <day of month>, <full weekday name>. For example: September 8, Tuesday. This is a solution created for [TechCorner Challenge #11] [Jscript] function DateFormat() { // Creates a driver DDT.ExcelDriver("C:\\Challenge11\\DateTime.xls", "Sheet1"); // Iterates through records while (! DDT.CurrentDriver.EOF()) { //Display the date in the format <month name> <day of month>, <full weekday name> DisplayDate(); DDT.CurrentDriver.Next(); } // Closes the driver DDT.CloseDriver(DDT.CurrentDriver.Name); } function DisplayDate() { for(i = 0; i < DDT.CurrentDriver.ColumnCount; i++) var dateA =aqConvert.VarToStr(DDT.CurrentDriver.Value(i)); //Convert the date from UTC to PST var dateB = aqDateTime.AddHours(dateA, -8); var date = aqConvert.DateTimeToFormatStr(dateB,"%B %d, %A"); Log.Message( "The date of " + dateA + " is : " + date ); }5.4KViews2likes6CommentsRe: [TechCorner Challenge #8] Finding Elements on a Web Page
Task: Create a TestComplete script that will go to theLeaderboard page, search foryourself(by your user name) and a user namedtristaanogrein the table and, if this user is mentioned on the Leaderboard, post their score to the log. This is a solution created for [TechCorner Challenge #8] //JScript function PostTheScore() { //Open the user leaderboard page Browsers.Item(btChrome).Navigate("https://community.smartbear.com/t5/TestComplete-General-Discussions/Leaderboard-and-Guide-to-Weekly-TestComplete-TechCorner/m-p/205075#M38161"); var Page = Sys.Browser().Page("*"); //identify the leaderboard table var table = Page.QuerySelector('table.techcornerleaderboard'); if (table.Exists) { // get the username of the connected session var userIcon = Page.QuerySelector("div.lia-quilt-row.lia-quilt-row-main-header img.lia-user-avatar-message").Click(); Page.Wait(); var myUserName = Page.QuerySelector('div.UserName a.lia-link-navigation.lia-page-link.lia-user-name-link'); Page.QuerySelector("div.lia-quilt-row.lia-quilt-row-main-header img.lia-user-avatar-message").Click(); if (myUserName.Exists) { // Search for my user (connected user) in the table props = ["ObjectType","contentText"]; values = ["Cell", "@"+myUserName.ContentText]; Mycell = table.FindChild(props, values, 20); if(Mycell.Exists) { // Display the score Log.Message("The score of my user "+ myUserName.ContentText+" is: "+table.cell(Mycell.RowIndex,2).innerText); } else { Log.Warning("My user is not found in the table of leaderboard"); } } else { Log.Warning("No user is connected"); } //Post the score of the participant tristaanogre // Search for the user in the table props = ["ObjectType","contentText"]; values = ["Cell", "@tristaanogre"]; CellP = table.FindChild(props, values, 20); if(CellP.Exists) { // Display the score Log.Message("The score of the user tristaanogre is: " +table.cell(CellP.RowIndex,2).innerText); } else { Log.Warning("The user tristaanogre is not found in the table of leaderboard"); } } else Log.Warning("The table was not found"); }4.9KViews1like3CommentsRe: [TechCorner Challenge #7] Retrieve Data from a Web Page
Task: Record a TestComplete script that will go to a user profile page (@TanyaGorbunovain our case) and get the number of Solutions for a specific community member. This is a solution created for [TechCorner Challenge #7] function GetSolNumber() { //Open the user profile page Browsers.Item(btChrome).Navigate("https://community.smartbear.com/t5/user/viewprofilepage/user-id/1737"); // Get the number of the solutions var ProfilePage = Sys.Browser().Page("*"); //Get the name of the profile var name = ProfilePage.QuerySelector('span.login-bold').contentText; // Identify the Solutionsdiv var solutionSec = ProfilePage.QuerySelector('div.UserSingleStatistic.lia-statistic-net_accepted_solutions.lia-component-users-widget-single-statistic div.lia-statistic-value'); // Check the result if (solutionSec != null) // If the element was found, display the number of Solutions for the selected community member. { Log.Message("the number of Solutions for the profile of the member " + name + " is: " + solutionSec.contentText); } else // If the element was not found, post a warning to the log Log.Warning("The element was not found."); }1.9KViews1like2CommentsRe: identify a web element
Hi Robert, Thank you for your response. The solution is working for me, but using this solution I should get all elements with the same selector and filter after that the result by text, it is taking much time and performance that's why i am searching for a direct solution like the function span:contains('CHF') which is not supported by testComplete. BR,2KViews0likes3Commentsidentify a web element
Hi, I have a web element without any static identifier. So i decide to detect this element using the css selector , based on the text. But i don't find a way with testComplete scripting. The example is :<span >CHF</span> Thank you for your support,Solved2KViews0likes5CommentsBulk assignement in tests under a test set
In QAComplete is not possible to do a bulk assignment to a particular tester for part of the tests in a specific test set . The manually update can take much time, especially when we talk about hundreds of imported tests under a test set. This feature will be very helpful for us.1.5KViews0likes2Comments