Friday, July 6, 2018

CTS Outlook Configuration


You can configure outlook using the below settings.

1) Open Control panel and select Mail
2) Select show profile now
3) Select Add now
4) Please give in a profile name (Associate ID -XXXXXX)
5) Click on Manually configure server settings
6) Please give next now
7) Select Microsoft Exchange server now and give next
8) Please type server name as " ctsinchnvcasa.cts.com" and  user name as your Associate ID(XXXXXX).
9) Click on more settings
10) Click on Connections
11) Click on Connect to Microsoft exchange using Http
12) Click on Exchange proxy settings
13) Update the Connection Settings and give under https://mail.cognizant.com
14) Click on connect to SSL only and only connect to proxy servers
15) Update the text box with the follow entries as "msstd:*.cognizant.com"
16) Click on both fast and slow networks
17) Change the NTLM authentication to basic authentication
18) Click on apply OK
19) Click on Next now
20) Select finish now


Monday, June 19, 2017

RubyXL Gem

https://github.com/weshatheleopard/rubyXL

def self.GetValueFromId(key, sheet, excelfile)
  if (@@WORKSHEETS_ID.eql? nil)
    @@WORKSHEETS_ID = Hash.new
  end
  workbook = nil  if (@@WORKSHEETS_ID.has_key? sheet+excelfile)
    workbook = @@WORKSHEETS_ID.fetch(sheet+excelfile)
  else    workbook = RubyXL::Parser.parse(excelfile)
    @@WORKSHEETS_ID.store(sheet+excelfile, workbook)
  end  worksheet = workbook[sheet]
  first_row = 0  worksheet.each do |row|
    break if row[0].nil?
    strTempValue = worksheet.sheet_data[first_row][0].value
    if strTempValue == key      strDataValue = worksheet.sheet_data[first_row][1].value
      return strDataValue    end    first_row +=1  endend

Configure RubyMine IDE

1) Click Run in Toolbar
2) Click Edit Configurations
3) Click "+" icon and select Cucumber
4) Select feature file which you want to run
5) Mention the tags if required
6) Provide these in Runner options:
--color
-r
features
APP_PATH="D:\Workspace\ekandroidapp\MyTripsV2.0\Emirates-staging-release-16-Apr.apk"

TEST_APP_PATH="D:\Workspace\ekandroidapp\MyTripsV2.0\test_servers\"  

7) Click Apply
8) Click Run again and run the feature file

Cucumber Calabash in Windows 32-Bit

As I have informed in the call, I am trying to run the app in my windows machine with the ruby version 2.3.1 and faced multiple issues. Went ahead with updating and commenting out some existing code in the framework and finally I am able to see atleast the app is loading and popping up the first page of the app which is language selection screen. After that test scripts are not able to proceed and when I debugged, found that the ids are not available in the apk that we received. I will check with the team regarding this on Sunday and will get the apk which have ids added already.

In Mac, we should be able to get to this stage(ids not available issue) without commenting/updating the existing code and any other issues listed below. So please try to run the app in Mac and update us.

Please find below the steps that I have followed on Windows.

If we try to run the app after running the ‘bundle install’, we will see the below error

WARNING: cannot load such file -- 2.3/gherkin_lexer_en
Couldn't load 2.3/gherkin_lexer_en

This is due to the old version old version(1.3.0) of cucumber. So, next I have tried to go with the latest version. I just commented out the cucumber version in the Gemfile as below and did ‘bundle update’ again.

gem "cucumber"#, "1.3.20"

After this, if we try to run the app we will see the below error

cannot load such file -- cucumber/formatter/gherkin_formatter_adapter (LoadError)
D:/EK-Ruby/workspace/ekandroidapp/MyTripsV2.0/features/android/support/json_expanded_formatter.rb:22:in `require'

Yesterday when I checked with the team here on this error, they said they are not using the above json_expanded_formatter. So we can comment out the code in the file json_expanded_formatter.rb for time being.

Running the app after this will throw the below error

      `Cucumber::Ast` no longer exists. These classes have moved into the `Cucumber::Core::Ast` namespace, but may not have the sa
me API. (RuntimeError)
      ./features/android/support/app_installation_hooks.rb:77:in `Before'

This is due to the module hierarchy or namespace change in the latest cucumber versions. In the existing framework code, they have some reference to the old cucumber classes/modules. That code is available in the file app_installation_hooks.rb and it is being used for the AppUpdate scenarios I guess. So I just went ahead with commenting out the code(the whole ‘Before do’ block which starts from line no. 67 ) for time being.

After this you will see the below error.

Timeout waiting for elements: * id:' frag_langauge_confirm_btn' (Calabash::Android::WaitHelpers::WaitError)
Timeout waiting for elements: * id:'flmenu_btn' (Calabash::Android::WaitHelpers::WaitError)

The above error is due to the non-availability of the ‘ids’ in the apk. When you run the app in console mode and do a query(“*”), you can see that ids are not added to any element.

Please let me know if you are facing any other issues apart from the above. 

Ruby Enviroment Setup in Windows

Please find below the steps that I followed to setup the environment in my Windows PC:

1)      First uninstall any version of Ruby installed in your system. Then go to C: drive and delete the corresponding Ruby folder which will have the gems installed (if any). Ensure that Ruby path is removed from the PATH in Environment Variables.

2)      Now based on your operating system (32-bit or 64-bit), chose & download the Ruby Installer (v-2.2.1) and DevKit from the FTP server. Install the Ruby in default C:\Ruby22-x64 (for 64-bit system) drive. Run the DevKit exe and extract it to directory C:\DevKit (recommended).
32-bit
/sftp/home/psftp_adhoc/upload/EK/Softwares/32-bit/rubyinstaller-2.2.1.exe
/sftp/home/psftp_adhoc/upload/EK/Softwares/32-bit/DevKit-mingw64-32-4.7.2-20130224-1151-sfx.exe
64-bit
/sftp/home/psftp_adhoc/upload/EK/Softwares/64-bit/rubyinstaller-2.2.1-x64.exe
/sftp/home/psftp_adhoc/upload/EK/Softwares/64-bit/DevKit-mingw64-64-4.7.2-20130224-1432-sfx.exe

3)      Check the Ruby path under the PATH section in Environment Variables.

4)      Open Command Prompt and go to C:\DevKit. Initialize the DevKit installer by running: "ruby dk.rb init". And then "ruby dk.rb install"

5)      Open Command Prompt and install the bundler gem -> “gem install bundler –v=1.13.6”. If needed add the “source” attribute as http://rubygems.org
NOTE: Do not install any other gem.

6)      Open Command Prompt and go to the EK project code (MyTrips branch code is placed in /sftp/home/psftp_adhoc/upload/EK/Branch_Code/ekandroidapp.zip directory) and enter into MyTripsV2.0 folder.

7)      Run the command “bundle install”. If needed add the “source” attribute as http://rubygems.org
NOTE: This will take some time, especially when installing gherkin gem

8)      Just for reference, attaching the gem list screenshot from Client which Murugaraj sent. And also screenshot from my system.

9)      Now place the APK file “APP-Rajatt-Feb-12.apk” in the “D:\Workspace\ekandroidapp\MyTripsV2.0” project workspace directory.

10)   Run the command “calabash-android resign APP-Rajatt-Feb-12.apk

11)   If that is successful then run the command “calabash-android run APP-Rajatt-Feb-12.apk”.
Note: If you get any error in resign step (step 10) then try the steps given in document “Calabash_Configuration_updated.pdf” under “Step 3: Configuration for Android”

That’s it, now I am able to run the app in my mobile device. Please note that after the run command, it might throw some warnings/error (probably related to what Murugaraj said) but the command won’t stop and the app would eventually start after some time. Please be patient J


Let me know if you find any other issues. My system is 64-bit operating system and everything worked as per the above steps. Now we are going to try in 32-bit systems of other team-mates here, will update if we come across any issues.




Wednesday, April 5, 2017

Git - SSL Certificate Problem

SSL certificate problem: unable to get local issuer certificate


1) Open Git Bash and run the command if you want to completely disable SSL verification.
git config --global http.sslVerify false
Note : But in this way, you may hit attacks like man in the middle attacks.
2) To disable the SSL for only one command, do the following:
 git -c http.sslVerify=false clone https://domain.com/path/to/git
3) Better solution is to do this:
https://blogs.msdn.microsoft.com/phkelley/2014/01/20/adding-a-corporate-or-self-signed-certificate-authority-to-git-exes-store/

4) Edit the Git config text file located at:
C:\Program Files (x86)\Git\etc\gitconfig
In the [http] block, add an option to disable sslVerify. It would look like this:
[http]
    sslVerify = false
    sslCAinfo = /bin/curl-ca-bundle.crt
That did the trick.
NOTE: This disables SSL verification and is not recommended as a long term solution.

UIAutomater Issue

Unable to connect to adb. Check if adb is installed correctly

Basically, the com.android.uiautomator.bindir property is not set in uiautomatorviewer.bat.
Edit the file and set the property to the path for android-sdk/tools folder.
1) C:\Users\593322\AppData\Local\Android\sdk\tools\bin

2) Open "uiautomatorviewer.bat" in textpad

3) call "%java_exe%" "-Djava.ext.dirs=%javaextdirs%" "-Dcom.android.uiautomator.bindir=C:\Users\593322\AppData\Local\Android\sdk\platform-tools" -jar %jarpath% %*

NOTE: Dcom.android.uiautomator.bindir => put your platform-tools folder path here.

CTS Outlook Configuration

You can configure outlook using the below settings. 1) Open Control panel and select Mail 2) Select show profile now 3) Select A...