Esempio n. 1
0
        /// <summary>
        /// This method gets WEBCloud settings from UI
        /// </summary>
        /// <returns>webcloud settings</returns>
        public WEBCloudConfigModel GetWEBCloudSettingsUI()
        {
            WEBCloudConfigModel settings = new WEBCloudConfigModel();

            try
            {
                WaitElementToBeClickable(WEBcloudsettingsswitchchkbox);

                settings.WEBCloudStatus = IsCheckboxActive(WEBCloudLocators.WEBCloudSettingsSwitchChkBoxId);

                settings.WEBCloudSettingsUrlTxtValue = WEBcloudurltxt.Text;

                var x = WEBcloudporttxt.GetAttribute("value");
                settings.WEBCloudPortValue = Convert.ToInt32(WEBcloudporttxt.GetAttribute("value"));

                //settings.WEBCloudSettingsStatusTxtValue =
                Logger.Info(string.Format("Retrived WEBCloud setting from info status {0}, URL {1}, port {2}",
                                          settings.WEBCloudStatus, settings.WEBCloudSettingsUrlTxtValue, settings.WEBCloudPortValue));
            }
            catch (Exception ex)
            {
                Logger.Error(ex, "failed to get WEBCloud setting from UI");
            }
            return(settings);
        }
Esempio n. 2
0
 /// <summary>
 /// Method to set WEBCloud Port.
 /// </summary>
 /// <param name="cloudport">If null then default will remain</param>
 /// <returns>default or value of WEBCloud port which is saved</returns>
 public int SetWEBCloudPort(string cloudport = null)
 {
     try
     {
         if (!string.IsNullOrEmpty(cloudport))
         {
             EnterValueTextbox(WEBcloudporttxt
                               , cloudport);
             Logger.Info("WEBCloud Port set to: " + cloudport);
         }
         else
         {
             Logger.Info("WEBCloud Port not to set. Keeping default");
         }
     }
     catch (Exception ex)
     {
         Logger.Error(ex, "Unable to Set WEBCloud Port");
         throw;
     }
     return(Convert.ToInt32(WEBcloudporttxt.GetAttribute("value")));
 }